Why not FP for Money?

Alex Martelli aleaxit at yahoo.com
Sat Sep 25 05:21:52 EDT 2004


Paul Rubin <http://phr.cx@NOSPAM.invalid> wrote:

> Andrew Dalke <adalke at mindspring.com> writes:
> > I'm against adding new literals.  There hasn't been
> > one added since complex in ... must have been the
> > mid-1990s.
> 
> Boolean literals were added just a few months ago.

Heh, you're both right (if 24 or so are "a few";-), for different
interpretations of the word 'literal'.  True and False introduced no new
syntax whatsoever: they're just built-in names, not even reserved
ones... personally, I see 'making None a keyword' as 'adding a new
literal' (it changes the syntax rules of the language, since suddenly
'None=33' becomes a syntax error) even though as a built-in name it was
around since forever; consistently, I don't see the mere introduction of
new built-in names without any special syntactic role as "adding new
literals".  I think we can accept a compromise:

- Andrew's way of expression was not 100% precise: he meant to be
  talking about new _syntactic categories_ of literals, not new values
  within existing categories.  After all, not all possible values
  within, say, the existing syntactic category 'literal strings' have
  been written yet, so we're "adding new literals" all the time, each
  and every time we write a quoted string that had never been written
  before (to be, well, literal about it;-).

- True and False did not add any syntactic category: there were lots
  of built-in names before, too, and several, like None or Ellipsis,
  existed exactly in order to name some constant value.


Alex
 



More information about the Python-list mailing list