'pretty' clever enough (Was: Parenthesized Target Notation)

Frank Boehme <[email protected]>
Newsgroups gmane.comp.lang.eiffel.smalleiffel
Message-ID <[email protected]>
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

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.

OTOH, this entire matter is perhaps not really important... Just because
Dominique mentioned another situation where pretty does more then moving
whitespace and comments.

cheers,

Frank

-- 
Dr Frank Boehme                      | Email: [email protected]
National University of Ireland, Cork | phone: +353-21-4903163
Dept of Computer Science             |   fax: +353-21-4903113
Cork, Ireland                        |

Did you know that if you play a Windows XP cd backwards, you
will hear the voice of Satan?
That's nothing! If you play it forward, it'll install Windows XP.
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.