new enum idiom

Harald Hanche-Olsen hanche at math.ntnu.no
Fri Jan 12 18:49:56 EST 2001


+ rcameszREMOVETHIS at dds.removethistoo.nl (Robert Amesz):

| Alex Martelli wrote:
| 
| Ah, Lisp, so beautiful, so pristine, so ... verbose. Well, it's great 
| for lists, but anything numeric is a chore. Let's see:
|    (EQ (PLUS 1 1) 2)
|    t
| Phew, so least that's still true... ;-)

Which is an accident of the implementation, in the same sense that
the following is accidentally true in python:
>>> 1+1 is 2
1

I'm sure you meant to write (= (+ 1 1) 2) ?

One neat thing about Lisp though, is how you can rewrite the syntax,
for example to allow you to write infix arithmetic if you wish.  This
takes much of the pain out of involved numerical work.  I wrote some
scheme macros once (many years ago) to accomplish this - it was only a
moderate amount of work.  In Common Lisp you can accomplish much the
same thing even more elegantly using reader macros.

but-now-I-have-a-feeling-we're-in-the-wrong-newsgroup-ly y'rs,
-- 
* Harald Hanche-Olsen     <URL:http://www.math.ntnu.no/~hanche/>
- Yes it works in practice - but does it work in theory?



More information about the Python-list mailing list