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

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

Re: Another question about lambdas


From: Michael Heerdegen
Subject: Re: Another question about lambdas
Date: Sun, 11 Dec 2022 01:38:12 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Gregory Heytings <gregory@heytings.org> writes:

> > (let* ((x 'l)
> >        (f (lambda () x))
> >        (x 'd))
> >   (funcall f))

> I think the following is clearer:
>
> (let ((x 'l))
>   (let ((f (lambda () x)))
>     (let ((x 'd))
>       (funcall f))))

Yes, I think so too.

It was a question for this only 98% serious (and 2% funny) kind of quiz,
so I tried to obfuscate a bit what is going on.  OTOH using let* I could
add the implicit question about how shadowing works in `let*' - that
question had been asked just some days ago, so I guess I couldn't
withstand.

Your form is better to demonstrate the binding aspect.

Michael.




reply via email to

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