[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: |
Sat, 10 Dec 2022 05:46:26 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Tassilo Horn wrote:
> (let ((i 0)
> (m (lambda (i)
> (lambda () i)))
> funs)
> (while (< i 100)
> (push (funcall m i) funs)
> (cl-incf i))
> (mapcar #'funcall funs))
>
> (let ((i 0)
> funs)
> (while (< i 100)
> (let ((j i))
> (push (lambda () j) funs))
> (cl-incf i))
> (mapcar #'funcall funs))
OK, so `lexical-binding' required, that's why they don't work
in the article buffer but suddenly work when I yank them into
an Elisp buffer ...
(setq-default lexical-binding t)
anyone?
--
underground experts united
https://dataswamp.org/~incal
- Re: Closures - do you understand them well?, (continued)
- Re: Closures - do you understand them well?, Emanuel Berg, 2022/12/10
- 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 <=
- 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
- Mutation - do you understand it really? (was: Closures - do you understand them well?), Stefan Monnier, 2022/12/10
- Re: Mutation - do you understand it really?, Michael Heerdegen, 2022/12/10
- Re: Closures - do you understand them well?, Michael Heerdegen, 2022/12/10
- Re: Closures - do you understand them well?, Tassilo Horn, 2022/12/11
- Re: Closures - do you understand them well?, Emanuel Berg, 2022/12/10
- RE: [External] : Re: Closures - do you understand them well?, Drew Adams, 2022/12/10
- Iteration macros (was: [External] : Re: Closures - do you understand them well?), Stefan Monnier, 2022/12/10