[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Closures - do you understand them well?
From: |
Emanuel Berg |
Subject: |
Re: Closures - do you understand them well? |
Date: |
Fri, 09 Dec 2022 22:23:21 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Tassilo Horn wrote:
> This time I'm prepared and have three versions making a new
> binding. Take this, Michael! :-)
>
> (let ((i 0)
> (m (lambda (i)
> (lambda () i)))
> funs)
> (while (< i 100)
> (push (funcall m i) funs)
> (cl-incf i))
> (mapcar #'funcall funs))
Same.
> (let ((i 0)
> funs)
> (while (< i 100)
> (let ((j i))
> (push (lambda () j) funs))
> (cl-incf i))
> (mapcar #'funcall funs))
DNC ...
> (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 ...
--
underground experts united
https://dataswamp.org/~incal
- Re: [External] : Re: Closures - do you understand them well?, (continued)
- Re: Closures - do you understand them well?, tomas, 2022/12/08
- Re: Closures - do you understand them well?, Michael Heerdegen, 2022/12/09
- Re: Closures - do you understand them well?, tomas, 2022/12/09
- Re: Closures - do you understand them well?, Tassilo Horn, 2022/12/09
- Re: Closures - do you understand them well?, Michael Heerdegen, 2022/12/09
- Re: Closures - do you understand them well?, Emanuel Berg, 2022/12/10
- Re: Closures - do you understand them well?,
Emanuel Berg <=
- Re: Closures - do you understand them well?, tomas, 2022/12/10
- Re: Closures - do you understand them well?, Michael Heerdegen, 2022/12/11
- Re: Closures - do you understand them well?, tomas, 2022/12/12
- Re: Closures - do you understand them well?, Michael Heerdegen, 2022/12/12
- Re: Closures - do you understand them well?, Emanuel Berg, 2022/12/22
- Re: Closures - do you understand them well?, tomas, 2022/12/23
- Re: Closures - do you understand them well?, Emanuel Berg, 2022/12/10
- Re: Closures - do you understand them well?, Michael Heerdegen, 2022/12/09
- Re: Closures - do you understand them well?, Tassilo Horn, 2022/12/10
- Re: Closures - do you understand them well?, Emanuel Berg, 2022/12/10