Python syntax in Lisp and Scheme
Joe Marshall
jrm at ccs.neu.edu
Tue Oct 14 12:09:17 EDT 2003
Raffael Cavallaro <raffaelcavallaro at junk.mail.me.not.mac.com> writes:
> 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)
I'm assuming that offset is lexically bound somewhere outside
the let expression so that I have to capture it with an in-place
FLET or LAMBDA. If we had an external add-offset then I'd have
to do something like
(add-offset offset some-list)
The problem with this is that you've essentially outlawed MAP.
(map 'list (make-adder offset) some-list)
The problem with this is that MAKE-ADDER is no less a lambda in drag,
and it isn't even local.
More information about the Python-list
mailing list