From: Stefan Monnier <monnier@iro.umontreal.ca>
To: help-gnu-emacs@gnu.org
Subject: Re: Differences between identical strings in Emacs lisp
Date: Tue, 07 Apr 2015 17:10:03 -0400 [thread overview]
Message-ID: <jwva8yjzm37.fsf-monnier+gmane.emacs.help@gnu.org> (raw)
In-Reply-To: DUB124-W4882427726E23EA5181182A8FE0@phx.gbl
> both evaluate to (186), indicating that the strings contain the same
> character(s). So they are identical.
No: the "\xBA" string does not contain any character, it only contains
bytes (we call such "string of bytes" a "unibyte string" and the usual
"string of characters" is called a "multibyte string").
And yes, the (integer) codes of the bytes of "\xBA" happen to be
identical to the (integer) codes of the characters of (concat '(#xBA)).
So (equal (append "\xBA" nil) (append "º" nil)) is non-nil.
Note that the same applies to: (equal (append "\xBA" nil) (append [#xBA] nil))
Stefan
next prev parent reply other threads:[~2015-04-07 21:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-06 13:21 Differences between identical strings in Emacs lisp Jürgen Hartmann
2015-04-07 21:10 ` Stefan Monnier [this message]
2015-04-08 11:02 ` Jürgen Hartmann
2015-04-08 13:44 ` Jürgen Hartmann
[not found] <mailman.76.1428326518.904.help-gnu-emacs@gnu.org>
2015-04-07 0:10 ` Pascal J. Bourguignon
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwva8yjzm37.fsf-monnier+gmane.emacs.help@gnu.org \
--to=monnier@iro.umontreal.ca \
--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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.