help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Closures - do you understand them well?


From: tomas
Subject: Re: Closures - do you understand them well?
Date: Sat, 10 Dec 2022 12:40:31 +0100

On Fri, Dec 09, 2022 at 10:23:21PM +0100, Emanuel Berg wrote:
> Tassilo Horn wrote:

[...]

> > (let ((i 0)
> >       funs)
> >   (while (< i 100)
> >     (push `(lambda () ,i) funs)
> >     (cl-incf i))
> >   (mapcar #'funcall funs))
> 
> Yes, but here there is no "new binding" exactly, rather the
> value is hard-coded onto the lambda ...

Look closely. There is one. Just at macro expansion (aka compile)
time. Welcome to Lisp's multiple personality :-)

Cheers
-- 
t

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]