[J3] RECURSIVE attribute?

Malcolm Cohen malcolm at nag-j.co.jp
Wed Nov 30 04:27:44 UTC 2022

Hi Steve,


As the standard refers to them as attributes, there is no doubt that they are attributes. Yes we usually say prefix or prefix-spec, because we are usually talking about the syntax.


RECURSIVE is not the default for assumed-length character, so no edit is needed there.


It might be better style to change

   “The RECURSIVE prefix-spec is advisory only.”


   “The RECURSIVE prefix-spec specifies the RECURSIVE attribute, which is advisory only.”

so that it matches C723 better.




..............Malcolm Cohen, NAG Oxford/Tokyo.


From: J3 <j3-bounces at mailman.j3-fortran.org> On Behalf Of Steve Lionel via J3
Sent: Wednesday, November 30, 2022 6:50 AM
To: General J3 interest list <j3 at mailman.j3-fortran.org>
Cc: Steve Lionel <steve at stevelionel.com>
Subject: [J3] RECURSIVE attribute?


On 11/29/2022 4:32 PM, Van Snyder wrote:

On Tue, 2022-11-29 at 15:28 -0500, Steve Lionel via J3 wrote:

C723 A function name declared with an asterisk type-param-value shall not be an array, a pointer, elemental, or pure. A function name declared with an asterisk type-param-value shall not have the RECURSIVE attribute.

Now that RECURSIVE is the default, does this constraint need to be revised so that it requires the NONRECURSIVE attribute?


Good question. The standard seems rather vague about whether RECURSIVE or NON_RECURSIVE are really attributes - they're not mentioned in Clause 8 and mainly referred to as prefixes, though N2209 says, "A subprogram is specified to have the NON_RECURSIVE attribute, or to be elemental (15.9), pure (15.7), or a separate module subprogram ( by a prefix in its initial SUBROUTINE or FUNCTION statement." There are a few other references now to "NON_RECURSIVE attribute". The term "RECURSIVE attribute" no longer appears other than in what is now C728. There is no concept I can see of a procedure having a "RECURSIVE attribute", only that recursive references are allowed by default.

I think this would make a good Edit paper for February - I'm interested to see what Malcolm thinks.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20221130/19288d4f/attachment.htm>

More information about the J3 mailing list