At 02:37 PM 12/4/98 , Bill Frantz wrote:
>Should E have hex input support. Output support in "any" radix (up to 36)
>is available via toString(radix). For example:
>
> ? 22 toString(16)
> # value 16
However, it bugs me to do these rather than provide a way to enter in a number with an arbitrary in-range radix. Smalltalk uses the format <radix>r<digits>
with <radix> itself, of course, expressed in base 10. For example, as I just tried in Squeak,
2r1010101 evaluates to 85, while 3r1010101 evaluates to 820.
I think I'd really like to adopt this convention *instead* of C's hex and octal convention, especially since (as with "="), the error message when they use the C convention can explain how to use the new convention instead. Hypothetically:
? seconds := 0x7fffffff/1000 # problem: Use 16r<digits> for hex rather than 0x<digits> ? seconds := 017777777777/1000 # problem: Use 8r<digits> for octal rather than 0<digits>
36rMARKM == 37453846 --I am not a number. PGP Fingerprint = 0EE0 1510 0700 E51B 1CCF 7C4B 8CE1 4E7F C9EB 83B1 --Well, maybe I am.