merits of Lisp vs Python

André Thieme address.good.until.2006.dec.22 at justmail.de
Mon Dec 11 13:52:17 EST 2006


Steven D'Aprano schrieb:

> Yes. But you can't redefine 1+2 in Python, at least not without hacking
> the interpreter. Can you redefine (+ 1 2) in Lisp? 

It is possible as was pointed out.
If anyone would do it, he/she would do it inside a package.
Then you would write:
(package:+ 1 2)

So in real world programs there is no danger.
In Python I could just say
def list():
   return 30

and won't get a warning. In Lisp I would at least have to shadow +
explicitely.


In Python it can't happen because + is not a function.
And what do you do if you want to pass + as a HOF?


André
-- 



More information about the Python-list mailing list