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

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

bug#9653: 24.0.50; `ucs-names' - Why all of the ("" . XXX) entries?


From: Stefan Monnier
Subject: bug#9653: 24.0.50; `ucs-names' - Why all of the ("" . XXX) entries?
Date: Mon, 03 Oct 2011 09:31:29 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux)

>> Handa-san, could you take a look at this?  Is (get-char-code-property
>> c 'name) supposed to return "" when the char has no name or is it
>> supposed to return nil?  Either way is fine by me (all those "" are
>> really one and the same string, so they don't waste memory).
> It returns "" in such a case in Emacs 24.  Emacs 23 returned
> nil but that behavior was fixed because Unicode Standard
> Annex #44 (Unicode Character Database) says as below:
> 4.2.8 Default Values
> [...]
>     * For miscellaneous properties which take strings as
>       values, such as the Unicode Name property, the default
>       value is a null string.
>                ^^^^^^^^^^^^^

I'm not opposed to this change, but your answer surprises me:
- we don't have to follow any standard.
- even less so when it talks about internal APIs rather than about
  externally-visible behavior.
- "null string" can mean nil just as well as it can mean "".
  They actually behave quite similarly: length/concat/mapcar treat them
  the same, aref signals an error in both cases, ...
So was there some other motivation (e.g. simpler implementation?
Simpler code somewhere else?)?  If not (i.e. all things being equal) I'd
prefer to use nil which is ever so slightly closer to usual Elisp
practice, and matches the Emacs-23 behavior.

        Stefan




reply via email to

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