This technical note is the text of proposal submitted by ISE to the Nonprofit International Consortium for Eiffel (NICE). It describes a set of extensions to Eiffel.
This is a working document, precise for the most part but informal in places, and is currently under discussion.
Because the note followed earlier discussions within the language committee of NICE, it lacks the customary "introduction" and "rationale" parts explaining the purpose of the proposed extensions. The rationale and applications should, however, be immediately clear to any reader familiar with Eiffel: how to allow creation instructions (of the form !! x, or create x according to the proposed new syntax) when the type of x is a formal generic parameter.
All page numbers refer to the current definition of Eiffel: the book Eiffel: The Language.
Constraint == "->" Class_typebecomes
Constraint == "->" Class_type [Creation_constraint]with (see page 285) Creation_constraint == create Feature_list end
Note: in the syntax for Creators, page 285, the keyword creation will be replaced by create.2. Validity
New validity rule VTCC, page 201:
Adaptation of VTCG, page 203 (with clause 3 already adapted for the "Generics in Constraints" change) now reads:
3. T conforms to the type obtained from D by substituting
any occurrence of a formal generic parameter of C by the
corresponding actual parameter.
4. If the constraint for G has a Generic_creators part,
then the C version of every procedure of BT listed (as
per rule VTCC, page 201) in that part is declared in BT
as a creation procedure.
In VGCC, page 286, replace clause 1 by
create x.proc (arguments)where the type of x is (as per VGCC (1)) a formal generic parameter with a constraint listing proc in its Generic_creators part, is to create an object of the type T used as the corresponding actual generic þarameter in the generic derivation considered, using as creation procedure the version of proc in the base class BT of T. As per VGCC (3), BT must declare that version as a creation procedure.