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: Emanuel Berg
Subject: Re: Closures - do you understand them well?
Date: Fri, 09 Dec 2022 19:48:09 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Eric Abrahamsen wrote:

> I would love to know closures well enough to put them into
> use without having to spend extra time thinking and testing.
> But the fact is I *do* need to spend extra time on it

Eval this:

  (lambda () x)

Same thing, no let-closure. Aren't lambdas like
that everywhere?

let-closures are not hard to understand, put a bunch of
`defun' in a `let' and use the variables like they were
globals, only they are not ...

> and I rarely hit upon a problem that's begging to be
> resolved with a closure, so...

Grep your source for global variables. Those are the ones you
can get rid of using let-closures, and without changing the
code using them. (Possible exception, for practical reasons:
Emacs options.)

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

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