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

NICE Language Committee: ms-anch-current

From Michael Schweitzer
Date: Sat, 16 Apr 94 15:10:16 +0200
To: bertrand@eiffel.com
Subject: MA-ANCH-Current
Cc: tynor@atlanta.twr.com
Content-Length: 1273
X-Lines: 43
Status: RO

-----------------------------------------------------------
Key   : Lang-94-Current-anchor
Title : 'like Current' in the context of an expanded class.
Message from: Michael Schweitzer (April 1994)
-----------------------------------------------------------

An entity declared to be of type 'like Current' always
denotes a reference type, even if the enclosing class is
declared to be expanded (ETL, page 215).

In general, I don't see any problems with this rule. But I
do see a problem in the case of basic types. For example,
the class INTEGER inherits the feature 'standard_copy'
which is introduced in GENERAL as

    frozen standard_copy (other : like Current) ...

Now, in the context of class INTEGER, 'like Current'
must be interpreted as a non-expanded INTEGER. But
such beasts don't exist.

Question:

If an ancestor of class INTEGER (or BOOLEAN, etc.) intro-
duces an entity of type 'like Current', how must we
interpret this in the context of this basic class?

For example:

What are the exact semantics of the instruction

    i.standard_copy (j)

if 'i' and 'j' are declared to be of type INTEGER?
I would expect that this is equivalent to

    i := j

but I'm not sure whether one can deduce this from
the language rules.