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: Arash Esbati
Subject: Re: Another question about lambdas
Date: Tue, 13 Dec 2022 12:26:47 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50

Michael Heerdegen <michael_heerdegen@web.de> writes:

> it seems you didn't notice that you participated in a quiz!

I think I grasped that, I've obviously missed the rule "No clarifying
questions allowed" ;-)

>> > What's the result of the following expression - and why?  Or maybe
>> > it is invalid?
>> >
>> > #+begin_src emacs-lisp
>> >   (let* ((x 'l)
>> >          (f (lambda () x))
>> >          (x 'd))
>> >     (funcall f))
>> > #+end_src
>
>> With lexical or with dynamic binding?
>
> "With lexical or with dynamic binding?" is the correct answer to the
> question.

So here another one for you: What's the result of this expression under
lexical binding?

(let (_)
  (defvar x)
  (let* ((x 'l)
         (f (lambda () x))
         (x 'd))
    (funcall f)))

Best, Arash



reply via email to

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