[comp.lang.eiffel] Unconstrained genericity

genly@bubble.multiflow.COM (Chris Hind Genly) (02/07/90)

There are a very restrictive set of actions that can be performed on
entities of unconstrained generic type.

        - They can be on the left of ':='
        - They can be on the right of ':='
        - They can be compared for equality and inequality
        - They can be passed
        - They can be returned.

Basically, the entity may be moved around, but not operated on.

This suggests a simple implementation.  When passing an entity as an
argument to a routine which expects an unconstrained generic argument,
just past it in the normal fashion, regardless of whether the argument
is a scalar or a reference to an object.  In general an entity of
uncontrained generic type would be treated exactly like an integer
would, except it could not be involved in operations other than the
ones listed above.

This would lead me to believe that integers, reals, and references
must all be the same size.  Which would, on most machines, imply that
Eiffel reals are C floats, and not C doubles.

Is this true for the ISE implementation?  If not, what do they do?
--
=======================================================================
Chris Hind Genly, N1GLZ - Multiflow Computer - mfci!genly (203)488-6090

	

weiner@novavax.UUCP (Bob Weiner) (02/09/90)

In article <1221@m3.mfci.UUCP> genly@bubble.multiflow.COM (Chris Hind Genly) writes:

   This would lead me to believe that integers, reals, and references
   must all be the same size.  Which would, on most machines, imply that
   Eiffel reals are C floats, and not C doubles.

Currently, this all of this is true.  Since everything was at first
assumed to fit in 32-bits, the introduction of 64-bit doubles has caused
ISE some problems.  Currently, doubles are treated as expanded instances
of a 64-bit class type I believe.  ISE is supposed to be working on
making their use more efficient.

-- 
Bob Weiner, Motorola, Inc.,   USENET:  ...!gatech!uflorida!novavax!weiner
(407) 364-2087