From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Hansen Newsgroups: gmane.emacs.help Subject: Re: ELisp: special read syntax for regular expressions? Date: Tue, 15 Apr 2008 06:24:02 +0200 Organization: disorganized Message-ID: <871w57eof1.fsf@localhorst.mine.nu> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1208234353 26396 80.91.229.12 (15 Apr 2008 04:39:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 15 Apr 2008 04:39:13 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Apr 15 06:39:48 2008 connect(): Connection refused Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JlcxN-0007eq-NU for geh-help-gnu-emacs@m.gmane.org; Tue, 15 Apr 2008 06:39:46 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jlcwh-0004H9-88 for geh-help-gnu-emacs@m.gmane.org; Tue, 15 Apr 2008 00:39:03 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JlcwI-0004ET-Fr for help-gnu-emacs@gnu.org; Tue, 15 Apr 2008 00:38:38 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JlcwE-00049i-TH for help-gnu-emacs@gnu.org; Tue, 15 Apr 2008 00:38:37 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JlcwE-00049X-JV for help-gnu-emacs@gnu.org; Tue, 15 Apr 2008 00:38:34 -0400 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JlcwE-00040Y-Cm for help-gnu-emacs@gnu.org; Tue, 15 Apr 2008 00:38:34 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Jlcw3-0005Q1-Rn for help-gnu-emacs@gnu.org; Tue, 15 Apr 2008 04:38:24 +0000 Original-Received: from e178043120.adsl.alicedsl.de ([85.178.43.120]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 15 Apr 2008 04:38:23 +0000 Original-Received: from david.hansen by e178043120.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 15 Apr 2008 04:38:23 +0000 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Original-Lines: 37 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: e178043120.adsl.alicedsl.de Mail-Copies-To: nobody User-Agent: Gnus/5.110009 (No Gnus v0.9) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:iWVAijpzTyeCIsCvtl2LgKRngr0= X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:53297 Archived-At: On Mon, 14 Apr 2008 23:27:53 +0000 (UTC) Ilya Zakharevich wrote: > [A complimentary Cc of this posting was sent to > David Hansen > ], who wrote in article : >> > I think I know the answer: one needs to allow a special read syntax >> > for regular expressions (the result being an ordinary string). This >> > way one can avoid the acute backslashitis [by inverting \( and (, >> > etc], the regular expressions may be specially indented, and the >> > syntax highlighter would have a chance to remove most of the remaining >> > complexity by proper highlighting (similar to CPerl one). >> > >> > What do you think? >> >> Have a look at the Gauche Scheme implementation. It has a regexp read >> syntax: #/.../. > > IMO, having SLASH hardwired as a delimiter is a silly choice; it makes > matching a slash harder, UNNECESSARILY. If one MUST hardwire some > delimiters, it should better be () (since un-backwacked parens are > almost guarantied to be matched inside a regular expression, one needs > no extra backwacking to enclose the REx into MATCHED parens). > > Any thoughts? Is /(REX) prohibited by some considerations? The lisper will expect a `#' to see that it it's a special read syntax, and it's probably a good idea to stick with CL conventions/standards[1]. I'd vote for #/REX. But I have to admit that I don't know anything about the emacs lisp reader. Maybe the discussion should be moved to emacs-devel. David Footnotes: [1] http://www.lispworks.com/documentation/HyperSpec/Body/02_dh.htm