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

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

Re: Surprising behaviour of 'append' with strings


From: Emanuel Berg
Subject: Re: Surprising behaviour of 'append' with strings
Date: Sun, 06 Nov 2022 13:35:18 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Stephen Berman wrote:

>> I tested it like this:
>>
>> (append "1")      -> "1"
>> (append "1" "2")  -> (49 . "2")
>>
>> That behaviour is surprising and it does not fit the bill.
>
> It appears you didn't appreciate the preceding line of the
> doc string: "The result is a list whose elements are the
> elements of all the arguments." So the result contains the
> elements of the string "1", which is just the single
> character ?1, whose value is 49.

Strings are not really lists of characters. Well, conceptually
they are! And `append' seems to agree ...

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




reply via email to

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