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

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

Re: run-with-timer does not display message


From: Emanuel Berg
Subject: Re: run-with-timer does not display message
Date: Sun, 20 Jul 2014 21:37:35 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Sebastian Wiesner <address@hidden> writes:

>> 2. Interestingly, what I can see, my method, with
>> backticks and commas, isn't that "lexical" - because
>> then, there, the actual values are inserted?
>
> Note quite.  The backquote is “static” in that it
> captures the *value* of the variable at the time the
> backquote is evaluated.  “Lexical” binding captures
> the *variable itself*.

Yes, the backtick-comma is to downright hard-code it,
although it is code, and not a human, who do the
hard-coding...

> This makes a difference if the variable is changed
> after capturing.  Considering the following example
> ...
>
> As you can see, changing "i" *after* creating the
> functions only affects the closure created by lexical
> binding.  The function created by the backquote is
> left untouched.

Yes, that is clear, but this example shows (to me) the
difference between using hard-coded values and using
variables (in general).

That example looks all-fine to me. Are you saying, with
dynamic scope, the `i' in the lambda wouldn't have been
affected by the `setq'? But to me, your example is the
way it should be, natural... Why then, would you want
to use dynamic scope, and why is it the default?

-- 
underground experts united


reply via email to

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