[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: |
Fri, 9 Dec 2022 05:49:34 +0100 |
On Thu, Dec 08, 2022 at 05:00:14PM -0500, Stefan Monnier via Users list for the
GNU Emacs text editor wrote:
> >> In ELisp, both `dotimes` and `dolist` create a new binding for `i` at
> >> each iteration of the loop.
> > This is probably what most people expect from a loop.
>
> I find this behavior cleaner, indeed (which is why I changed `dotimes`
> and `dolist` to provide that behavior :-).
This is funny. I did come up with the right answer. Truth be
said, Michael's "tone" was set up in a way to raise awareness
("now, look carefully"), so this has surely played a role.
That said, this is actually the behaviour I expect (and like),
so reading your note taught me something: expectations here
seem to vary, and mine isn't the "only", much less the "right"
one. And I might meet loop constructs with local bindings :)
So I learnt something from the riddle, after all [1].
> > `cl-loop' doesn't.
>
> Indeed, when I looked at it, I decided it was too much trouble figuring
> out how to change `cl-loop` to provide that behavior :-(
> IMO `cl-loop` is too complex for its own good.
Uh-huh. I never wanted to learn a whole language to just do
looping :-)
Thanks for the riddle and all the follow-up!
[1] The most general rule seems still to be: "all generalisations
suck"
--
t
signature.asc
Description: PGP signature
- Re: Closures - do you understand them well?, (continued)
- Re: Closures - do you understand them well?, Michael Heerdegen, 2022/12/08
- Re: Closures - do you understand them well?, Stefan Monnier, 2022/12/08
- RE: [External] : Re: Closures - do you understand them well?, Drew Adams, 2022/12/08
- Re: [External] : Re: Closures - do you understand them well?, Stefan Monnier, 2022/12/08
- Re: [External] : Re: Closures - do you understand them well?, Emanuel Berg, 2022/12/10
- RE: [External] : Re: Closures - do you understand them well?, Tomas Hlavaty, 2022/12/09
- Re: [External] : Re: Closures - do you understand them well?, Emanuel Berg, 2022/12/10
- Re: [External] : 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
- Re: [External] : Re: Closures - do you understand them well?, Emanuel Berg, 2022/12/15
- Re: Closures - do you understand them well?,
tomas <=
- 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, 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