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

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

Re: Appending lists


From: Emanuel Berg
Subject: Re: Appending lists
Date: Wed, 16 Jun 2021 18:54:18 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Jean Louis wrote:

> You said vairable did not change, maybe it did not change
> somewhere underground

This is how I understand it:

The variable has a reference to the first cons cell of the
list. The cons cell has a car and a cdr as always, where the
cdr is a reference to the second element of the list, which is
also a cons cell, and so on.

The car of the first element's cons cell remains the same but
the cdr has changed as a side-effect of `nreverse' (or
`nconc').

So when the variable seemingly holding the list, but actually
only holding a reference to the first cons cell, when this
variable is used one will have a different list as a result
even tho the reference is the same, unchanged.

tomas, is this correct? Maybe I won't have to draw the diagram
after all... :)

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

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