Precursor construct: the original proposal
The Precursor mechanism is a recently introduced Eiffel construct The
mechanism was proposed in mid-1997 (see credits at
the end) to the language committee of NICE, the Nonprofit International
Consortium for Eiffel, and formally approved by the committee in a vote of
October 1997.
The rest of this document contains the text of the formal proposal as
adopted by the NICE language committee. You should first have read the
companion document presenting an
January 1999 note: For an up-to-date version see a small
revision of this proposal. The changes are a change of order of
components in the syntax (the old order is still supported in ISE Eiffel
4.3) and a simplification/refinement of the validity rule. informal
description of the mechanism.
New reserved word
(To be added to list in "Eiffel: The Language", page 553.)
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):
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
or
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.
Credits
(This section is not part of the proposal and the vote does not apply
to it.)
The Precursor proposal was put together and presented to NICE by
Bertrand Meyer of ISE but the language construct is the result of
collective work. The contributions of the following people are
acknowledged (please signal any omissions): Eric Bezault, Roger Browne,
James McKim, Xavier Le Vourch, Bertrand Meyer, Frieder Monninger, Steve
Tynor, Dino Valente, Kim Walden.
|