Python syntax in Lisp and Scheme
Raffael Cavallaro
raffaelcavallaro at junk.mail.me.not.mac.com
Tue Oct 14 11:32:53 EDT 2003
In article <8yno1dvi.fsf at comcast.net>, prunesquallor at comcast.net wrote:
> (flet ((add-offset (x) (+ x offset)))
> (map 'list #'add-offset some-list))
But flet is just lambda in drag. I mean real, named functions, with
defun. Then the code becomes:
(add-offset the-list)
instead of either of theversions you gave. The implementation details of
add-offset are elswere, to be consulted only when needed. They don't
interrupt the flow of the code, or the reader's understanding of what it
does. If you need that optimization, you can always throw in (declaim
(inline 'add-offset)) before add-offset's definition(s).
I guess I'm arguing that the low level implementation details should not
be inlined by the programmer, but by the compiler. To my eye, anonymous
functions look like programmer inlining.
More information about the Python-list
mailing list