Re: Numerics

Peter Gummer <[email protected]>
Newsgroups gmane.comp.lang.eiffel.smalleiffel
Message-ID <[email protected]>
On 25/03/2005, at 8:14 PM, Colnet Dominique wrote:
> Paolo Redaelli wrote:
>> Il mer, 2005-03-23 alle 10:10, Dominique Colnet ha scritto:
>>>> But {REAL_32} 1.0 would suffice.... see chapter 29.3 "FORCING A 
>>>> TYPE ON
>>>> A CONSTANT" in ETL3, page 679.
>>>
>>> This notation looks like a C cast :-)
>> Indeed! Well I don't think that the position of the right brace is 
>> that
>> important: are "{INTEGER_64 1}" and "{INTEGER_64} 1" so different?
> Just take the point of view of a newbie. With our choice there is 
> clearly only one expression while in the ECMA choice, there are two 
> expressions or at least two separate lexical units. I argue that it is 
> not clear for a newbie who does not know about C casts to understand 
> that {INTEGER_64} 1 is the notation of value 1 mapped as an 
> INTEGER_64.

Not necessarily. A newbie doesn't have to know about C at all.

"{SOME_TYPE}"" is common in Eiffel (e.g., following "create", "export", 
etc.); ETL3 is making it more common. "{INTEGER_64} 1" looks like 
ETL3's mechanism for converting an expression explicitly: see page 681.

Knowledge of this Eiffel idiom is all that's required for it to seem 
clear. The ECMA choice is much more consistent with the rest of Eiffel 
than SmartEiffel's "{INTEGER_64 1}". Any resemblance to C is merely 
incidental.

- Peter Gummer
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.