unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Emanuel Berg <incal@dataswamp.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Surprising behaviour of 'append' with strings
Date: Sun, 06 Nov 2022 13:35:18 +0100	[thread overview]
Message-ID: <871qqgdzw9.fsf@dataswamp.org> (raw)
In-Reply-To: 87v8ns5li1.fsf@gmx.net

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	other threads:[~2022-11-06 12:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <6554cc02-2082-3dca-73cc-05fee1c6c4d0.ref@yahoo.de>
2022-11-06 11:05 ` Surprising behaviour of 'append' with strings R. Diez
2022-11-06 12:13   ` Stephen Berman
2022-11-06 12:35     ` Emanuel Berg [this message]
2022-11-06 20:28       ` Michael Heerdegen
2022-11-06 20:57         ` Emanuel Berg
2022-11-06 12:19   ` Emanuel Berg
2022-11-06 12:32   ` Emanuel Berg
2022-11-06 12:37   ` Eli Zaretskii
2022-11-06 12:39   ` Jean Louis
2022-11-06 20:33   ` Michael Heerdegen
2022-11-06 21:45     ` [External] : " Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871qqgdzw9.fsf@dataswamp.org \
    --to=incal@dataswamp.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).