Exponents of numbers
Bert Freudenberg
bert at impara.de
Thu Sep 15 12:45:35 UTC 2005
Am 15.09.2005 um 10:14 schrieb Andreas Raab:
> Hi -
>
> I just got horribly bitten by the fact that 16r1d4 is being parsed
> as 65536 (yes, it really does). Looking at the methods in question
> it appears that Number class>>canParseExponentFor:base:from: acceps
> *all* of e, d, or q as exponent indicator.
>
> Why??? This seems completely superfluous and causes actual harm if
> you happen to misspell a hex constant.
Well, the obvious choice is e which still would be a hex digit. The
Blue Book only has e, btw.
I had a conversation with Dan once about Smalltalk's syntax for
literal numbers and he was quite proud of the purely syntactical
rules enabled by distinguishing upper and lower case.
- Bert -
More information about the Squeak-dev
mailing list
|