J3/01-285r1 Subject: Interpretation request on ENTRY points. From: Malcolm Cohen To: J3 Date: 22nd August 2001 NUMBER: 000095 TITLE: Names of functions, results and entry points. KEYWORDS: DEFECT TYPE: Erratum STATUS: J3 consideration in progress QUESTIONS: Consider some examples of FUNCTION/RESULT/ENTRY combinations: (1) FUNCTION F() RESULT(F) This is not allowed ([207:8]). (2) ENTRY E() RESULT(E) This is also not allowed ([209:35]). (3) FUNCTION F() RESULT(R) ENTRY E() RESULT(R) This is allowed (implied by the sentence at [209:41-43]). (4) FUNCTION F() ENTRY E() RESULT(F) Does not appear to be disallowed, though why RESULT(F) should be prohibited on the FUNCTION statement but allowed on the ENTRY statement bemuses me. (5) FUNCTION F() RESULT(E) ENTRY E() Does not appear to be disallowed, though why RESULT(E) should be prohibited on the ENTRY statement but allowed on the FUNCTION statement bemuses me. (6) FUNCTION F() ENTRY E() RESULT(R) ENTRY G() RESULT(R) Appears to be (explicitly?) allowed. (7) FUNCTION F() ENTRY E() ENTRY G() RESULT(E) Does not appear to be disallowed, though why RESULT(E) should be prohibited on an ENTRY statement but allowed on another ENTRY statement bemuses me. (8) FUNCTION F() RESULT(R) ENTRY(R) RESULT(F) Does not appear to be disallowed, even though swapping the RESULT clauses would not be allowed. Q1. Is my analysis correct? If not, why? Q2. Does making the function RECURSIVE alter anything? Further, consider the following examples: (9) RECURSIVE FUNCTION F() RESULT(E) ENTRY E() RESULT(R) This appears to be allowed by the usual rules, but I find it hard to interpret "If RESULT is specified in the ENTRY statement and RECURSIVE is specified in the FUNCTION statement, the interface of the function defined by the ENTRY statement is explicit within the function subprogram." ([210:3-5]) (10) FUNCTION F() RESULT(R) ENTRY E() RESULT(F) This appears to be allowed by the usual rules, but I find it hard to interpret "If RESULT is specified, ... all occurrences of the function name in statements in the scoping unit are recursive function references." ([207:30-32]) Q3. Are these allowed? Come to think of it, in what way is passing the function name as an actual argument a "recursive function reference"? The text seems obviously broken whether these are allowed or not. Q4. Should the text be clarified? ANSWER: A1-A3. Only examples (3) and (6) were intended to be valid. A RESULT clause should only name an existing entity when that entity is also an explicitly specified RESULT variable. Edits are supplied to clarify this. A4. Yes, the text should be clarified. Edits are supplied to clarify and correct the text. EDITS: [207:8] Before "." insert "and shall not be the same as the in any ENTRY statement in the subprogram". [207:32] Change "are recursive function references" to "refer to the function itself". [209:35] Change "" to "the in the FUNCTION statement and shall not be the same as the in any ENTRY statement in the subprogram." SUBMITTED BY: Malcolm Cohen HISTORY: 01-285 m158 Submitted 01-285r1 m158 Draft answer ----------------------------------------------------------