python vs. lisp (whereis quote?)

Rolf Marvin Bøe Lindgren roffe at morgoth.uio.no
Tue Jul 20 08:44:19 EDT 1999


[ nbecker

| One feature of lisp (emacs lisp actually) that I think is pretty cool
| is the "hooks".  A hook is basically unevaluated code that will be run 
| by eval later.
|
| I suspect python lacks this capability.  As I understand it, the only
| similar capability is "eval".  But I think eval expects a string,
| which it will then parse.  While the capability is similar, having to
| parse a string could be inefficient.
|
| Am I correct that what is missing is the ability to postpone
| evaluation using "quote"?

in Lisp, there is no syntactic difference between code and data, and
that is what makes the hook mechanism possible the way it is implemented
in Emacs.  if Python had a way of representing code as data, Python
could have had the same support for hooks. 

if eval expects a string, and if the string can contain code, then you
have it, haven't you?

-- 
Rolf Lindgren                                        http://www.uio.no/~roffe/
roffe at tag.uio.no




More information about the Python-list mailing list