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

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

Re: `append' vs. `nconc'


From: Emanuel Berg
Subject: Re: `append' vs. `nconc'
Date: Fri, 01 Jan 2016 19:31:58 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Teemu Likonen <tlikonen@iki.fi> writes:

>> OK, then what functions, other than `nconc', are
>> mutators (or, how do you now)?
>
> A manual or the specification says it.
> Such operation is called "destructive".

A function is destructive if it changes its arguments.
I suppose it is even more destructive if it changes
things that aren't even passed to the function.

What I can tell this definition is straightforward so
it is rather a question of knowing what functions are
like that.

For example, the help for `nconc' says:

    (nconc &rest LISTS)

    Concatenate any number of lists by altering them.
    Only the last argument is not altered, and need not be
    a list.

And `append':

    (append &rest SEQUENCES)

    Concatenate all the arguments and make the result
    a list.
    The result is a list whose elements are the
    elements of all the arguments.
    Each argument may be a list, vector or string.
    The last argument is not copied, just used as the
    tail of the new list.

You need to be attentive but if you are, sure, it
is there.

-- 
underground experts united
http://user.it.uu.se/~embe8573




reply via email to

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