J3/11-196
To: J3
From: Malcolm Cohen
Subject: ENTRY interp
Date: 2011 June 13
----------------------------------------------------------------------
NUMBER:
TITLE: ENTRY point RESULT variable
KEYWORDS: ENTRY, RESULT
DEFECT TYPE: Erratum
STATUS: J3 consideration in progress
QUESTION:
MODULE m
REAL x
CONTAINS
FUNCTION f()
f = 1
x = 2
RETURN
ENTRY e() RESULT(x)
x = 3
END FUNCTION
END MODULE
Is this standard-conforming?
If so, what is the result of referencing f() and e(), and what effect
does that have on the module variable x?
Note that the standard prohibits dummy arguments of an entry point
from appearing in executable statements ahead of the ENTRY statement
(unless they are also dummy arguments of an earlier ENTRY statement or
the FUNCTION statement), but makes no similar requirement on the
RESULT name.
ANSWER:
This program was not meant to be conforming.
An edit is provided to correct this mistake in the standard.
EDIT:
Append new statement to 12.6.2.6p8 [310:20],
"A name that appears as a in an ENTRY statement
shall not appear in any executable statement that precedes the
ENTRY statement."
Append new statement to 12.6.2.6p9 [310:23]
"A name that appears as a in an ENTRY statement
shall not appear in the expression of a statement function unless
the name is also a dummy argument of that statement function.
SUBMITTED BY: Malcolm Cohen
HISTORY: 11-nnn m195 Submitted
----------------------------------------------------------------------