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

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

Re: Changing outline-minor-mode keybindings for texinfo files


From: tomas
Subject: Re: Changing outline-minor-mode keybindings for texinfo files
Date: Sat, 15 May 2021 23:10:39 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Fri, May 14, 2021 at 09:49:48PM +0300, Jean Louis wrote:

[...]

> Yes, I see by testing, it works with it as you say.
> 
> I was thinking this:
> 
> (setq a 1) ⇒ 1
> 
> (let ((b a))
>     (setq b 2)) ⇒ 2

This is because you set b to the *value* of a, then set b
to something different. You don't change the value of a
(in this case it'd be difficult anyway, because... how do
you change 2? It is immutable.

It becomes different when you have a mutable thing and
mutate it.

Try:

  (setq a (list 'apple 'banana 'cranberry))
  (setq b a)
  a
  => (apple banana cranberry)

  ; now we mutate b's value, which is the same
  ; as a's value
  (setf (caddr b) 'chives)
  a
  ; a's value has changed!
  => (apple banana chives)

You can do that with keymaps and lists, because they
are mutable objects, but not with 2.

In Lisp, symbols are also immutable. Strings are not.
This depends on the language.

Cheers
 - t

Attachment: signature.asc
Description: Digital signature


reply via email to

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