This site contains older material on Eiffel. For the main Eiffel page, see http://www.eiffel.com.

The Precursor proposal

This is the Precursor proposal as was submitted by Bertrand Meyer (based on collective work, see credits at end) to the NICE language committee

New reserved word

(To be added to list in "Eiffel: The Language", page 553.)


	Precursor

Syntax change

Page 342, definition of Unqualified_call (previously Entity [Actuals]) becomes


		Unqualified_call == Feature_of_call [Actuals]

with the new construct definitions


		Feature_of_call == Entity | Precursor

		Precursor == [Parent_qualification] Precursor

		Parent_qualification == { Class_name }

Validity changes

Note (not subject to vote): everything could be done within VUEX, page 368. I have found it more clear to introduce two new constraints. In VUEX, page 368, replace condition 1 by

    1. The call is an Unqualified_call.

with the new validity rule VUNQ

    An Unqualified_call appearing in a routine r of a class C is valid if and only if it satisfies one of the following two conditions:

      1. Its Feature_of_call is the final name of a feature of C.

      2. Its Feature_of_call is of the Precursor kind.

and the new validity rule VUPR (including a definition):

    A Precursor is valid if and only if it satisfies the following three conditions:

      1. It appears in a Routine_body.

      2. That Routine_body is part of the declaration of exactly one routine r of C.

      3. That declaration is a redefinition.

      4. If it is is the redefinition of routines from more than one parent, the Parent_qualification part is present.

      5. If the Parent_qualification part is present, its Class_name is the name of one of the parents of C from which C redefines r.

    The "immediate precursor" of r in this case is the routine being redefined from a parent of C, determined in case of ambiguity (under condition 2 of the rule) by the Class_name of the given Parent_qualification.

Also, in VUAR, page 369, rewrite the parenthetical sentence on line 2 of the rule by

    (For an Unqualified_call take target to be Current; if the Feature_of_call is of the Precursor kind, take fname to be the immediate precursor of the enclosing routine.)

Semantics change

Insert a new section on page 345 between 21.8 and 21.9:

    Precursor calls A call of the Precursor form, that is

      Precursor (...)

    or

      {PARENT} Precursor (...)

    may only appear in the redefinition of a routine r. The original version of r in the parent is known as the "immediate precursor".

    In this case the feature of the call, fname, is the immediate precursor.

Also, the next section (21.9) should begin

    Now assume target_value is not void and the call is not of the Precursor form.

Note

(This note is not part of the proposal and the vote does not apply to it.)

Since "Object-Oriented Software Construction, second edition" (Prentice Hall, 1997) uses double braces, as in {{PARENT}}, rather than single braces as in {PARENT}, it may be desirable for compilers to accept both forms.

    Note for Web page (13 February 1998): ISE Eiffel version 4.2 indeed accepts both forms.

Credits

(This section is not part of the proposal and the vote does not apply to it.)

The language construct described in this proposal is the result of collective work. The contributions of the following people are acknowledged (with apologies for any omissions, which will be corrected if reported): Eric Bezault, Roger Browne, James McKim, Xavier Le Vourch, Bertrand Meyer, Frieder Monninger, Steve Tynor, Dino Valente, Kim Walden.