Numeric literal syntax

Tom Harris celephicus at gmail.com
Mon Sep 8 18:32:29 EDT 2008


On Thu, Sep 4, 2008 at 10:22 AM, Alexander Schmolck
<a.schmolck at gmail.com> wrote:
>
> It's amazing that after over half a century of computing we still can't denote
> numbers with more than 4 digits readably in the vast majority of contexts.
>

I agree. So did Forth's early designers. That is why Forth's number
parser considers a word that starts with a number and has embedded
punctuation to be a 32 bit integer, and simply ignores the
punctuation. I haven't used Forth in years, but it seems a neat
solution to the problem of decoding a long string of numbers: let the
user put in whatever they want, the parser ignores it. I usually used
a comma (with no surrounding whitespace of course), but it was your
choice. You could also do this in whatever base you were working in,
so you could punctuate a 32 bit hex number to correspond to the bit
fields inside it. Of course not applicable to Python.

-- 

Tom Harris <celephicus(AT)gmail(DOT)com>



More information about the Python-list mailing list