Parsing Numbers

David T. Lewis lewis at mail.msen.com
Sat Sep 17 23:22:44 UTC 2005


On Sat, Sep 17, 2005 at 06:32:57PM -0400, Andreas Raab wrote:
> 
> The fact that "16r1E4 ~= 16r1e4" is deeply disturbing if you ever have 
> to copy hex constants from somewhere else. This is just what I did and I 
> was staring for an hour at that code wondering why the heck it would 
> compute total nonsense. The fact that this was crypto code and that 
> crypto code often involves lots of magic hex constants makes it even 
> more disturbing (just think about what havoc a wrongly spelled hex 
> constant might wreck on you).

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

Dave

p.s. Squeak 2.4 is *really* fast.




More information about the Squeak-dev mailing list