From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.bugs Subject: bug#9653: 24.0.50; `ucs-names' - Why all of the ("" . XXX) entries? Date: Wed, 05 Oct 2011 17:59:06 +0900 Message-ID: References: <74B14D2A03144E798C9415172D5FE01A@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1317805219 20810 80.91.229.12 (5 Oct 2011 09:00:19 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 5 Oct 2011 09:00:19 +0000 (UTC) Cc: 9653@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 05 11:00:15 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RBNKp-0005wA-0A for geb-bug-gnu-emacs@m.gmane.org; Wed, 05 Oct 2011 11:00:15 +0200 Original-Received: from localhost ([::1]:55480 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBNKo-0007Pf-5h for geb-bug-gnu-emacs@m.gmane.org; Wed, 05 Oct 2011 05:00:14 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:39135) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBNKk-0007PW-9N for bug-gnu-emacs@gnu.org; Wed, 05 Oct 2011 05:00:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RBNKe-00058S-CR for bug-gnu-emacs@gnu.org; Wed, 05 Oct 2011 05:00:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45999) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBNKe-000583-5Q for bug-gnu-emacs@gnu.org; Wed, 05 Oct 2011 05:00:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1RBNKe-000588-Jp for bug-gnu-emacs@gnu.org; Wed, 05 Oct 2011 05:00:05 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <74B14D2A03144E798C9415172D5FE01A@us.oracle.com> Resent-From: Kenichi Handa Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 05 Oct 2011 09:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9653 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9653-submit@debbugs.gnu.org id=B9653.131780515819638 (code B ref 9653); Wed, 05 Oct 2011 09:00:03 +0000 Original-Received: (at 9653) by debbugs.gnu.org; 5 Oct 2011 08:59:18 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RBNJt-00056g-S5 for submit@debbugs.gnu.org; Wed, 05 Oct 2011 04:59:18 -0400 Original-Received: from mx1.aist.go.jp ([150.29.246.133]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RBNJp-00056V-JP for 9653@debbugs.gnu.org; Wed, 05 Oct 2011 04:59:16 -0400 Original-Received: from rqsmtp2.aist.go.jp (rqsmtp2.aist.go.jp [150.29.254.123]) by mx1.aist.go.jp with ESMTP id p958x8Re028740; Wed, 5 Oct 2011 17:59:08 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp4.aist.go.jp by rqsmtp2.aist.go.jp with ESMTP id p958x7xY012033; Wed, 5 Oct 2011 17:59:07 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp4.aist.go.jp with ESMTP id p958x6Gu010440; Wed, 5 Oct 2011 17:59:06 +0900 (JST) env-from (handa@m17n.org) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 05 Oct 2011 05:00:04 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:52207 Archived-At: You wrote: > >> - even less so when it talks about internal APIs rather than about > >> externally-visible behavior. > > I think that UCD is talking about external visible behaviour. > > If so, it doesn't apply to the behavior of (get-char-code-property CHAR > 'name) which is an internal detail. I think what get-char-code-proeprty returns belongs to an external API, and currently I put this docstring to `name' property. "Unicode character name. Property value is a string." So, when one wants to know a Unicode name of a character, he can call get-char-code-proeprty and it should return "". > >> - "null string" can mean nil just as well as it can mean "". > > But, as I wrote, nil usually means > > no-value/not-specified/unassigned/unknown, which is > > different from the explicit "". > > Indeed, and that's why I prefer nil: a char's name should be pretty much > unique and descriptive, so "" really isn't a char name, it just means > "this char doesn't have a name" and in Elisp we usually represent this > with nil. Perhaps we are requesting two functionalities to get-char-code-property. One is to return the specific name of a character or nil if it doesn't have such a name, the other is to just return a name that Unicode defines for a character. As there's just one function at the moment, we should find which functionality is more useful. > >> So was there some other motivation (e.g. simpler implementation? > > No. > > Then please revert it to using nil. So, your opinion is that the former functionality is more useful, right? Then, ok, I'll change it back, and, change the above docstring accordingly. > >> Simpler code somewhere else?)? > > Yes, hypothetically. You can safely write, for instance, > > (search-forward (get-char-code-property CHAR 'name) ...) > > or > > (insert (get-char-code-property CHAR 'name) ...) > > without checking the return value. > > I doubt there will ever be code that can do the above because the "" > case will need special treatment. > > So we end comparing things like > > (insert (or (get-char-code-property CHAR 'name) "")) > with > (insert (let ((name (get-char-code-property CHAR 'name))) > (if (equal name "") "" name))) > > where nil is clearly a more convenient choice. I'll repeat that when one want to know what Unicode says about the name of a character, the answer is "", not "". > >> If not (i.e. all things being equal) I'd prefer to use nil which is > >> ever so slightly closer to usual Elisp practice, > > Really? I've thought nil and "" are rather different object in Elisp. > > Of course they are, nil usually means "not found" or something like > that, and I think it suits this case perfectly. I'm not sure because there are multiple use-cases of get-char-code-property, and nil is better only in some of them. But, it's just "I'm not sure". If you are sure, as I wrote above, I'll change it back. --- Kenichi Handa handa@m17n.org