[J3] Simple functions in Constant Expressions

Vipul Parekh parekhvs at gmail.com
Wed Aug 25 16:43:05 UTC 2021


On Wed, Aug 25, 2021 at 12:23 PM Brad Richardson via J3 <
j3 at mailman.j3-fortran.org> wrote:

> ..
> There have been requests in a few places asking for something equivalent
> to C++'s `constexpr`. Looking at the recently added `simple` feature, I
> think the constraints are sufficient for `simple function`s to be
> effectively `constexpr`. Would it be possible to add `simple` functions to
> the section on Constant Expressions (Section 10.1.12).
>

Around the time of the Tokyo meeting m219 that I could not join due to
financial constraints with not having my employer or a sponsor to back
attendance at Fortran standard meetings, I reached out to Malcolm who had
posted paper (19-201) with the same request as Brad above.

Malcolm's reply was a firm no, it can't be done, that the US15 worklist
item approved by WG5 toward Fortran 202X can allow *executable code* in
SIMPLE procedures which cannot be in constant expressions.

I don't know if the thinking still holds, I will be rather curious about
this.

Ondrej has brought up the GitHub based "community" forum to brainstorm
ideas toward Fortran 202Y proposals and Steve/WG5 appears to have at least
verbally lent support toward the premise.  If so, please see this thread at
that forum titled, "Add CONSTEXPR procedures in Fortran":
https://github.com/j3-fortran/fortran_proposals/issues/214

It will be nice if all the members of J3 who have *voting* privilege and
those who represent member countries toward WG5 can also start using the
GitHub forum and start providing feedback on idea proposals, simple "thumbs
down" or "thumbs up" and if that is NOT "politically" correct somehow, then
to post a few words that provide technical guidance as to why something is
not a good idea, or how to make it a good one, or acknowledge the idea is
worthy of further consideration.

Thanks,
Vipul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20210825/724c2a96/attachment.htm>


More information about the J3 mailing list