From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: Unquoted special characters in regexps Date: Sun, 26 Feb 2006 18:10:10 +0100 Message-ID: <4401E0F2.7030800@gmx.at> References: <4400AD8E.5050001@gmx.at> <4400BBB1.2050800@gmx.at> <200602252213.k1PMDBP24413@raven.dms.auburn.edu> <4401A98D.3070809@gmx.at> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1141005951 8956 80.91.229.2 (27 Feb 2006 02:05:51 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 27 Feb 2006 02:05:51 +0000 (UTC) Cc: Luc Teirlinck , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 27 03:05:49 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FDXlj-0006ZV-Lv for ged-emacs-devel@m.gmane.org; Mon, 27 Feb 2006 03:05:48 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FDXlp-0005kU-FK for ged-emacs-devel@m.gmane.org; Sun, 26 Feb 2006 21:05:54 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FDPkX-0003PG-Tn for emacs-devel@gnu.org; Sun, 26 Feb 2006 12:32:03 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FDPkR-0003Mc-U4 for emacs-devel@gnu.org; Sun, 26 Feb 2006 12:31:57 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FDPkL-0003Hd-5T for emacs-devel@gnu.org; Sun, 26 Feb 2006 12:31:50 -0500 Original-Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.52) id 1FDPkq-0006hV-Vq for emacs-devel@gnu.org; Sun, 26 Feb 2006 12:32:21 -0500 Original-Received: (qmail invoked by alias); 26 Feb 2006 17:31:39 -0000 Original-Received: from N908P007.adsl.highway.telekom.at (EHLO [62.47.57.103]) [62.47.57.103] by mail.gmx.net (mp038) with SMTP; 26 Feb 2006 18:31:39 +0100 X-Authenticated: #14592706 User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en Original-To: Andreas Schwab In-Reply-To: X-Y-GMX-Trusted: 0 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:51000 Archived-At: >>That of closing a character alternative. When you write >> >>(defvar foo "]") >>(defvar bar "\\]") >> >>you can't interchangeably use `foo' and `bar' in an arbitrary regular >>expression. Some people call this "referential transparency". > > > Of course you can't, since the meaning of '\' is context dependent. When you say that outside a character alternative `]' and `\\]' have the same meaning you abandon the principle of referential transparency. >>Anyway, the first `]' has a special meaning but it's not "inside" the >>character alternative. > > > It is part of it, just like the leading '['. As a consequence, in your model "[" is a valid regexp too. >>It does have a special meaning because `]' is special _outside_ >>character alternatives. > > > This is wrong. Outside of a character set ']' has no special meaning > whatsoever, independent of the context. On a similar footing you can say that `*' has no special meaning unless it's preceded by a character. Hence "*foo" is valid too in your model. >>According to the Elisp manual all these exhibit "poor practice" since >>you didn't quote the second `]'s. > > > It's a bug in the manual. Please fix it.