J3/04-111
Date: 08 Dec. 2003
To: J3
From: Dan Nagle
Subject: Automatic for Procedure Variables
Many vendors support an "automatic" declaration for procedure
variables to indicate the opposite of "save", that is, that
there is to be a new instance of each variable for each instance
of the procedure. This applies to recursive procedures as well as
multihtreaded programs.
I want to avoid module variables so as not to complicate modules.
Number:
Title: Automatic Procedure Variables
Submitted By: J3
Status: For Consideration
References: Section 5.1.2.13 SAVE
Basic Functionality: Request a new instance of a variable for each
instance of a procedure.
Rationale: The standard currently provides the SAVE attribute
to request persistent storage for a variable, but
no way exists within the standard to request per instance
of the procedure storage. Many vendors have implemented
an AUTOMATIC attribute to fulfill this requirement.
This paper proposes to standardize this attribute
for procedure variables only.
Estimated Impact: The effect should be low, since vendors must implement
recursive procedures anyway, and many have implemented
automatic already.
Detailed Specification: The automatic attribute would parallel the save
attribute. It may be placed on the declaration
statement, or applied to a list or to an entire
procedure if no list is present.
Example:
real, automatic :: x, y( 100)
History: