[Top][All Lists]

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

RE: [External] : Re: Which Elisp types are mutable?

From: Drew Adams
Subject: RE: [External] : Re: Which Elisp types are mutable?
Date: Mon, 5 Jul 2021 20:39:54 +0000

> Hm. If you change a variable's value... does that count
> as "mutating the symbol"? If you change the binding (e.g.
> by entering another scope or by leaving it)?

(Changing a symbol's binding, with `let' etc.
is more complicated.  I mentioned global value.)

If you look at a Lisp symbol as being an object
with properties, then yes; changing its variable
value changes the object - its mutable state.

There's nothing very special involved here.  It's
just that people unused to Lisp won't necessarily
think that a symbol is a complex thing, and that
it "owns" its value as a variable (and its value
as a function, which for a Lisp-2 is separate).

The symbol is not its name.  In many languages
you have only to think about a name and its
binding to a value.  At a lower level you think
of a memory location (address) and the value at
that address.

In Lisp a source-code name can refer to a symbol
object.  That object itself has other things /
properties, besides a value as a variable.

reply via email to

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