[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
- Surprising behaviour of 'append' with strings, R. Diez, 2022/11/06
- Re: Surprising behaviour of 'append' with strings, Eli Zaretskii, 2022/11/06
- Re: Surprising behaviour of 'append' with strings, Jean Louis, 2022/11/06
- Re: Surprising behaviour of 'append' with strings, Emanuel Berg, 2022/11/06
- Re: Surprising behaviour of 'append' with strings, Emanuel Berg, 2022/11/06
- Re: Surprising behaviour of 'append' with strings, Michael Heerdegen, 2022/11/06