# Questions about statement functions

**URL:** <https://fortran-lang.discourse.group/t/questions-about-statement-functions/3341>\
**Category:** Help\
**Created:** [April 28, 2022, 1:20pm UTC](https://fortran-lang.discourse.group/t/questions-about-statement-functions/3341 "2022-04-28T13:20:59Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![FortranFan](https://avatars.discourse-cdn.com/v4/letter/f/96bed5/32.png) [@FortranFan](https://fortran-lang.discourse.group/u/FortranFan)\
**Post date:** [March 12, 2023, 8:30pm UTC](https://fortran-lang.discourse.group/t/questions-about-statement-functions/3341/13 "2023-03-12T20:30:06Z")

</div>

> [@RonShepard](#):
>
> You should read through that discussion again, I certainly did provide an example …

Here’s that [**thread**](https://fortran-lang.discourse.group/t/question-about-contains/5260).

You did **not** provide any example that supports your claim, “It is not always possible to replace a statement function with an internal procedure because of the nesting levels of internal procedures is limited by the standard.”

Such an example would be along the following lines: 1) here’s a standard-conforming code which makes use of `statement function`s, and 2) any reasonable attempt to refactor the code in 1) to (an) `internal procedure`(s) is not viable because the Fortran standard does not allow an internal procedure to host another internal procedure.

@RonShepard - seriously, pay attention to this - you didn’t even remotely come close to showing such an example involving any issues with the refactoring of `statement function`s. That you feel it will be valuable for the language to consider permitting internal procedures to host internal procedures is ok, please propose it as such some place, preferably at the [**J3 Fortran GitHub site**](https://github.com/j3-fortran/fortran_proposals).

But the fact is the semantics around `statement function`s in the standard is limited and its semantics hardly suggests any nesting as supported by the standard. So then your attempt to make an use case out of statement functions for nesting of internal procedures isn’t likely going to get you far. Try to read between the lines in this [**paper**](https://j3-fortran.org/doc/year/23/23-147.txt). Unless you can find a strong sponsor who can drive even weak proposals through, almost all the proposals with Fortran are DOA. Thus you need extremely strong and convincing use cases with proposals, but here with the proposal on the nesting of internal procedures, I don’t even see you make an attempt at a strong case.

---

_[View the full topic](https://fortran-lang.discourse.group/t/questions-about-statement-functions/3341)._
