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

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

Re: Adding Lists/Sequences


From: David Kastrup
Subject: Re: Adding Lists/Sequences
Date: Wed, 24 Sep 2008 00:11:00 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

Thierry Volpiatto <address@hidden> writes:

> Nordlöw <address@hidden> writes:
>
>> Is there a general function, say foo, that adds lists or, even better,
>> sequences together?
>>
>> I want this
>>   (foo '("a" "b") '("c" "d"))
>> to evaluate to
>>   '("a" "b" "c" "d")
>
> ,----
> | ELISP> (nconc '("a" "b" "c") '("d" "e" "f")) 
> | ("a" "b" "c" "d" "e" "f")
> `----
>
> Note: `append' is not destructive

This is so bad that I can't believe it.

(defun ugh () (nconc '("a" "b" "c") '("d" "e" "f")))
(ugh) -> ("a" "b" "c" "d" "e" "f")
(ugh) -> ("a" "b" "c" "d" "e" "f" . #3)

The latter is a tail-cyclic list.

(ugh) -> hangs

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum


reply via email to

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