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

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

Re: Appending lists


From: tomas
Subject: Re: Appending lists
Date: Wed, 16 Jun 2021 13:54:04 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Wed, Jun 16, 2021 at 02:30:51PM +0300, Jean Louis wrote:

[...]

> (setq list '(A B C)) ⇒ (A B C)
> (nconc list '(1 2 3)) ⇒ (A B C 1 2 3)
> list  ⇒ (A B C 1 2 3)
> 
> So maybe he was thinking that symbol `list' does not change, and I
> understood it that variable value does not change.
> 
> Why not come back to that and explain me how the variable `list' did
> not change from (A B C) to (A B C 1 2 3)?

Because the content of 'list' (wasn't it 'list1' last time we talked?)
is *not* the whole list. It is a reference to the list's head.

What changed was the cdr of some cons cell downstream. The variable
doesn't see it.

Now I'm really stopping here. One last recommendation: do some
box-and-pointer diagrams. They are really helpful.

Cheers
 - t

Attachment: signature.asc
Description: Digital signature


reply via email to

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