Parsing Numbers

Samuel Tardieu sam at rfc1149.net
Mon Sep 19 07:25:15 UTC 2005


>>>>> "David" == David T Lewis <lewis at mail.msen.com> writes:

David> Well, if you can accept that "(2 + 3 * 4) ~= (2 + (3 * 4))",
David> you should not be deeply disturbed to find that "16r1E4 ~=
David> 16r1e4". This appears to be a well established convention for
David> Smalltalk (it works that way in e.g.  Squeak 2.4).  It does
David> have a nice internal consistency, and the behavior is well
David> defined (albeit not well enough documented).

In Ada, we use base#literal#[exponent] which has no ambiguity at all and
is much cleaner. 16#1e4# is 0x1E4 while 16#1#e4 is 0x10000. Maybe we
should look for a similar scheme applicable to Squeak and warn about
ambiguities for the older notation. We would still be backward
compatible but we would be able to use an unambiguous notation.

  Sam
-- 
Samuel Tardieu -- sam at rfc1149.net -- http://www.rfc1149.net/sam




More information about the Squeak-dev mailing list