From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel,gmane.emacs.pretest.bugs Subject: Re: Refactoring xml.el namespace handling Date: 05 Mar 2004 14:29:43 -0500 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <87d67r2k2a.fsf@weblog.localhost> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1078868733 4453 80.91.224.253 (9 Mar 2004 21:45:33 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 9 Mar 2004 21:45:33 +0000 (UTC) Cc: emacs-pretest-bug@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue Mar 09 22:45:17 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1B0p2L-0006xD-00 for ; Tue, 09 Mar 2004 22:45:17 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1B0p2L-0007Gl-00 for ; Tue, 09 Mar 2004 22:45:17 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B0p1w-0008TX-84 for emacs-devel@quimby.gnus.org; Tue, 09 Mar 2004 16:44:52 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1AzL1g-0007w6-1d for emacs-devel@gnu.org; Fri, 05 Mar 2004 14:30:28 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1AzL15-0007qR-9Z for emacs-devel@gnu.org; Fri, 05 Mar 2004 14:30:22 -0500 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.30) id 1AzL14-0007qH-OZ; Fri, 05 Mar 2004 14:29:50 -0500 Original-Received: from asado.iro.umontreal.ca (asado.iro.umontreal.ca [132.204.24.84]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 401C920D2D; Fri, 5 Mar 2004 14:29:44 -0500 (EST) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id 0B7928C8E4; Fri, 5 Mar 2004 14:29:44 -0500 (EST) Original-To: mah@everybody.org (Mark A. Hershberger) In-Reply-To: <87d67r2k2a.fsf@weblog.localhost> Original-Lines: 40 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=0, requis 5) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:20281 gmane.emacs.pretest.bugs:2357 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:20281 >> Thank you. Here is a counter patch. The main difference is that it uses >> 'http://foo/bar rather than :http://foo/bar so as to avoid an unnecessary >> (concat ":" foo) and also so that (symbol-name foo) immediately returns >> a usable URL. > There needs to be a way of differentiating between the (unlikely) > namespace uri "nil" and "" (that is, no namespace), which is why I believe we > need to stick with (concat ":" foo). I must say that I do not know enough of those details to understand what would be the ideal solution. I don't see where the confusion between "nil" and "" could come from, but I do see that using a symbol such as the one returned by (intern "") can be somewhat inconvenient if you ever want to print&read the lisp representation. I would actually recommend to intern all those symbols in a separate obarray rather than in the main one. This way you could use nil for the "" case without interfering with (intern "nil" xml-obarray). You could also then use (intern-soft foo xml-obarray) to check whether foo already exists without getting nasty surprises when foo is the string "nil". Finally it would avoid polluting the main obarray. > Also, since I believe we need a prefix, using ':' means less work for > the programmer since :symbols are automatically interned. (FWIW, it > was James Clark who gave me this idea of using ':' as the prefix.) If a prefix is needed than indeed `:' is fine. I just feel like there's got to be a way to avoid it altogether. > I confess that I'm not very moved by the argument of a usable URL > since namespace URIs needn't be usable URLs. My understanding is > that they are essentially opaque IDs. You're probably right. It just seems cleaner without the `:'. If someone else wants to install this patch, please do. I don't have time to look at it just now. Stefan