Re: K.I.S.S. Factor (Re: Numerics)

Dominique Colnet <[email protected]>
Newsgroups gmane.comp.lang.eiffel.smalleiffel
Message-ID <[email protected]>
Greg C wrote:

> What if I write "000000001"? That doesn't look like an eight-bit integer value
You are right that in such a situation, the compiler should warn the 
user that leading 0 are not significant and that 000000001 is still an 
INTEGER_8. Anyway, the choice we made avoids information loss.
> to me. Or what about a constant expression, ie
> 
>     (8001/63)     -- Or: 127
> 
> For consistency's sake, shouldn't this also be an eight-bit integer?
No because of the signature of infix "/" in INTEGER_GENERAL.
Thus, 8001/3 can only be a REAL.
> 
> What you've implemented seems a rather narrow, hard-hearted sort of
> consistency. a way of saying "we'll consistently give you the least amount of
> something as possible." Ie we're going to give you only one byte instead of
> four  for this integer constant.
What we have tried to do is not to fall in problems we encountered in 
the past. All my team is composed of experimented people with different 
backgrounds.
Furthermore, we have your feedback on this list !
As usual, best regards to all,
-- 
--------------------------------------------------------------
[email protected] -- IUT (Nancy 2) -- INRIA Lorraine
http://SmartEiffel.loria.fr  --  The GNU Eiffel Compiler
POST: Loria, B.P. 239,54506 Vandoeuvre les Nancy Cedex, FRANCE
Voice:+33 0383913140 Mobile: +33 0665362381 Fax:+33 0383581701
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.