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

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

Re: Lexical vs. dynamic: small examples?


From: Eduardo Ochs
Subject: Re: Lexical vs. dynamic: small examples?
Date: Sat, 14 Aug 2021 01:12:14 -0300

On Sat, 14 Aug 2021 at 00:56, Emanuel Berg via Users list for the GNU
Emacs text editor <help-gnu-emacs@gnu.org> wrote:
>
> Have a look:
>
>   (let ((a 1))
>     (do-something a) ; 1 is here
>     (do-something-else) ) ; but if a is referenced here, it isn't 1
>                           ; not the same a!

Hi Emanuel,
Thanks! I converted your idea to this...

(setq a 42)
(defun *a10 () (* a 10))

(let ((a 99))
  (list (* a 10) (*a10))
  )

(let ((b 99))
  (list (* b 10) (*a10))
  )

Cheers =),
  Eduardo Ochs



reply via email to

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