You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a duplicate of #40 (comment), but keep it here as a top level issue, so that it is not buried in comments. However, every body please do read all the comments there, so that we do not repeat the discussion.
What I took away from all of that discussion is that something like this, as an executable part statement, would answer all of the needs that were expressed:
Note that initialization is required. The type would be inferred from the initializer if not explicit. There is no SAVE attribute possible, explicit or implicit. It's not a construct, so no end let is needed. Later object-names could refer to earlier ones in the same statement in their initializations. If IMMUTABLE, the object-name could not appear in a variable definition context.
This subsumes auto, init, immutability, and other proposals, and more or less replaces associate.
It is convenient to give a variable a value at the time it is declared, but in a procedure
integer :: i=0
has the implicit
save
attribute, which may not be wanted, and which many new Fortran programmers stumble over. I suggest adding aninit
attribute so thatinteger, init :: i=0, j=1
has the same meaning as
Then the programmer can set the value of a variable in a declaration with the
init
,save
, orparameter
attribute, depending on the desired behavior.The text was updated successfully, but these errors were encountered: