Re: 'pretty' clever enough (Was: Parenthesized Target Notation)
Dominique Colnet <[email protected]>
| Newsgroups | gmane.comp.lang.eiffel.smalleiffel |
|---|---|
| Message-ID | <[email protected]> |
Frank Boehme wrote: > Dominique Colnet wrote: >>I have not tried since a long time, but I remember that our `pretty´ >>command is clever enough to add the extra semicolon when necessary. > > > Once you mention the clever modifications the pretty command makes, I am > sometimes annoyed when it replaces expressions in manifest numeric > notations by their value. > > For example, pretty will change > > bytes_per_megabyte: INTEGER is > once > Result := 1024 * 1024 > end > > into > > bytes_per_megabyte: INTEGER is > once > Result := 1048576 > end > This is clearly a bug ! > I dislike this for two reasons: > > 1. In the resulting notation, the keyword 'once' has become pointless, > i.e. it is identical to > > bytes_per_megabyte: INTEGER is 1048576 > > 2. The intended purpose of using 'once' was the use of a "computed > constant". In this case, the reason was to make the code easier to > understand. "Computed constants" are also used in order to achieve > plataform independence (for example by using "Maximum_integer" in an > expression). In that case, of course', pretty cannot pre-compute > anything. But in both cases, the use of 'once' is justified in the first > place and pretty should not make any second guess, I think. I agree. -- -------------------------------------------------------------- [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