From JANSHEP@torolab2.vnet.ibm.com Wed Nov 25 05:11:17 1992
Received: from vnet.ibm.com by dkuug.dk with SMTP id AA13933
  (5.65c8/IDA-1.4.4j for <SC22WG5@dkuug.dk>); Wed, 25 Nov 1992 17:05:03 +0100
Message-Id: <199211251605.AA13933@dkuug.dk>
Received: from TOROLAB2 by vnet.ibm.com (IBM VM SMTP V2R2) with BSMTP id 7842;
   Wed, 25 Nov 92 10:41:18 EST
Date: Wed, 25 Nov 92 10:11:17 EST
From: "Janice Shepherd" <JANSHEP@torolab2.vnet.ibm.com>
To: SC22WG5@dkuug.dk
Subject: SAVE and named constants
X-Charset: ASCII
X-Char-Esc: 29

>>Janice, can you explain to me why this matters? SAVEd or not a symbolic
>>constant always has the same defined value on every invocation of the
>>program unit. So why do we care? Why should we clutter up the defect report
>>and corrigendum with interpretations which cannot effect the execution of
>>any program? Or have I missed something?

>>Lawrie

I think it matters for the following reasons:
 1) Most people will be surprised if named constants are allowed in
    SAVE statements.  When I asked 3 members of X3J3 whether they
    thought named constants were allowed in SAVE statements all 3
    said 'NO'. All 3 were quite surprised when I told them there was
    no such restriction in the standard.
 2) As you point out named constants always have the same defined value
    on every invocation. Allowing them in SAVE statements would be
    redundant. ANSI Fortran 77 did not allow them in SAVE statements.
    Was there discussion during the development of Fortran 90 about
    specifically allowing named constants to appear in SAVE statements?
    Or was it just that they were forgotten?  I don't have a long
    history with the X3J3 committee so I did not know the answer to
    this question. So when I asked 3 members of X3J3 I chose members
    with a long term association with X3J3. Based on the answers I
    received I can only guess that restricting named constants from
    SAVE statements was left out inadvertently. Please let me know
    if you recall the issue being discussed.
 3) Since it appears that many people already assume that named
    constants are not allowed in SAVE statements, I believe that
    by specifically disallowing them we do a good service for the user.
    If a user has written a named constant in a SAVE statement
    there is a good chance that the user had meant to type some other
    name. By giving them an error message the user will get a
    chance to fix the error that might otherwise be very hard to
    track down.
 4) I can imagine that someone new to Fortran would misunderstand
    named constants being allowed in SAVE statements and think that
    named constants must always appear in SAVE statements. While this
    last issue is clearly not that significant, I think it is best
    to not have such easily misunderstood features in the language.

Do you believe it is common practice to put named constants in SAVE
statements?
Thanks.
Janice Shepherd.
IBM Canada

> --------------------------------------------------------------------
>
>
>     To: X3J3                                                  92-
>   From: Janice C. Shepherd
>
>NUMBER:
>TITLE: PARAMETER statements and SAVE statements
>KEYWORDS: PARAMETER, named constant, SAVE
>DEFECT TYPE: ERRATUM
>STATUS:
>
>QUESTION: Can a named constant appear in a SAVE statement?
>In ANSI FORTRAN 77 named constants were not allowed to appear in a
>SAVE statement. Fortran 90 appears to allow named constants in
>SAVE statements.
>
>ANSWER: No, a named constant must not appear in a SAVE statement.
>Edits are provided to indicate this restriction.
>
>REFERENCES: ISO/IEC 1539:1991 (E) sections 5.1, 5.1.2.5
>
>EDITS:  Change the 16th constraint of section 5.1 to
>   'The SAVE attribute must not be specified for an object that is in
> a common block, a dummy argument, a procedure, a function result,
> an automatic data object or an object with the PARAMETER attribute.'
>
>        Change the penultimate sentence of section 5.1.2.5 from
>   'or an automatic data object' to 'an automatic data object or an
>    object with the PARAMETER attribute'
>
>SUBMITTED BY: Janice C. Shepherd
>
>HISTORY:              <meeting no.>        <information>
>
