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

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

Re: Understanding the "let" construct and the setting of variables


From: Emanuel Berg
Subject: Re: Understanding the "let" construct and the setting of variables
Date: Fri, 18 Dec 2020 21:48:53 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Joost Kremers wrote:

> Not sure I understand the question. With `setq`, two things
> can happen: either there is already a binding for the
> variable, in which case `setq` updates the binding (assigns
> a new value to the existing variable), or there is no such
> binding (i.e., the variable doesn't exist), and in that case
> the variable is created.

That's right, so use `setq' to create and manipulate global
variables; inside functions, use `let/let*'.

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




reply via email to

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