merits of Lisp vs Python
Alex Mizrahi
udodenko at users.sourceforge.net
Sun Dec 10 06:04:02 EST 2006
(message (Hello 'Paul)
(you :wrote :on '(10 Dec 2006 00:01:34 -0800))
(
PR> I'm not persuaded, I haven't examined his example carefully yet but it
PR> looks like basically a reader hack. Lexical scope in Lisp means among
PR> other things lexical closures and (maybe I'm mistaken) it seemed to me
PR> Alex's example didn't supply that.
lexical scope is pretty low-level concept that affects lot of stuff, so it
requires lot of changes -- we are not extending a language, but build a new
one actually.
we'll have to create object 'lexical environment' and to query it for
variable values instead of just using variable values: var -> (query env
'var).
then, we'll need to make closures -- that is a pair of environment and code
itself.
so, it's very close to writting new interpreter -- but it's order of
magnitude easier to write this interpreter via macros than from scratch,
most other language constructs can be reused.
that's the point -- macros allow to implement a language with aprox. same
syntax but different semantics relatively easily.
PR> I'm also unconvinced (so far) of his description of call/cc as a Lisp
PR> macro but that's going to take me some head scratching.
there is a chapter about continuations in Paul Graham's "On Lisp".
"Common Lisp doesn't provide call/cc, but with a little extra effort we can
do the same things as we can in Scheme. This section shows how to use macros
to build continuations in Common Lisp programs."
)
(With-best-regards '(Alex Mizrahi) :aka 'killer_storm)
"People who lust for the Feel of keys on their fingertips (c) Inity")
More information about the Python-list
mailing list