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

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

Re: Why is `pop' not named `npop'?


From: Yuri Khan
Subject: Re: Why is `pop' not named `npop'?
Date: Wed, 17 Jan 2024 18:13:11 +0700

On Wed, 17 Jan 2024 at 17:53, Emanuel Berg <incal@dataswamp.org> wrote:

> >> the `pop' macro is destructive. Why isn't it called `npop'
> >> then? [...]

> > but there is also no need for a non-destructive pop since we
> > already have car.
>
> But shouldn't `pop' be called "ncar" then?

The ‘n’ in ‘nreverse’ and other destructive functions is said to mean
‘non-consing’, that is, they won’t allocate new cons cells but rather
modify what is already there to achieve the desired structure. The
focus is not on destructiveness, it is on the lack of pressure on the
allocator.

‘car’ is already as non-consing as it gets.



reply via email to

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