unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: <tomas@tuxteam.de>
To: help-gnu-emacs@gnu.org
Cc: michael-franzese@gmx.com, Yuri Khan <yuri.v.khan@gmail.com>
Subject: Re: Changing outline-minor-mode keybindings for texinfo files
Date: Sat, 15 May 2021 23:10:39 +0200	[thread overview]
Message-ID: <20210515211039.GA25802@tuxteam.de> (raw)
In-Reply-To: <YJ7GTDc0DdWnAeMK@protected.localdomain>

[-- Attachment #1: Type: text/plain, Size: 963 bytes --]

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 #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2021-05-15 21:10 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-14  5:47 Changing outline-minor-mode keybindings for texinfo files michael-franzese
2021-05-14  7:28 ` michael-franzese
2021-05-14  9:51   ` Jean Louis
2021-05-14 10:04     ` michael-franzese
2021-05-14 12:24       ` michael-franzese
2021-05-14 13:31         ` michael-franzese
2021-05-14 14:03           ` Jean Louis
2021-05-14 16:00             ` Yuri Khan
2021-05-14 16:19               ` michael-franzese
2021-05-14 18:49               ` Jean Louis
2021-05-15 21:10                 ` tomas [this message]
2021-05-14 16:20           ` Yuri Khan
2021-05-14 16:36             ` michael-franzese
2021-05-14 20:10               ` Yuri Khan
2021-05-15  5:25                 ` michael-franzese
2021-05-15  5:58                   ` Yuri Khan
2021-05-15  6:07                     ` michael-franzese
2021-05-15  6:35                       ` Yuri Khan
2021-05-15  5:59                 ` michael-franzese
2021-05-15  6:02                   ` Yuri Khan
2021-05-15  6:21                     ` michael-franzese
2021-05-15  6:36                       ` Yuri Khan
2021-05-15  8:40                         ` michael-franzese
2021-05-15  9:00                           ` Yuri Khan
2021-05-15 10:48                             ` michael-franzese
2021-05-14 18:13             ` michael-franzese
2021-05-14 13:55         ` Jean Louis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210515211039.GA25802@tuxteam.de \
    --to=tomas@tuxteam.de \
    --cc=help-gnu-emacs@gnu.org \
    --cc=michael-franzese@gmx.com \
    --cc=yuri.v.khan@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).