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

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

RE: [External] : Re: Easy to add with push but not to the end of a list


From: Drew Adams
Subject: RE: [External] : Re: Easy to add with push but not to the end of a list
Date: Mon, 28 Nov 2022 22:41:33 +0000

> There are never any qualms about putting something at the beginning
> of a list.  One should not take a different attitude to adding after
> the last entry.

Qualms?  Do you understand that a list is either
nil (an atom) or a cons?  And that a cons holds
one list element and a pointer to another list?

Now think about _why_ accessing Lisp lists from
the head is different from accessing them from
the end.  To get to the end you need to cdr
down the list, cons by cons - one way or another.

(Or else you have to have saved a reference to
that last cons or its cdr.  In that case you can
get there directly.)

Should one take a different attitude to the two
lane directions when driving down a two-lane
highway?  The "business end" of a weapon or tool
versus the other end?  Qualms indeed.

Liberté, Egalité, Fraternité !  Go for it. 

reply via email to

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