From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitri Paduchikh Newsgroups: gmane.emacs.devel Subject: Re: Raw strings (experimental patches inside) Date: Sat, 11 Aug 2012 17:05:53 +0600 Message-ID: <87r4rd7koe.fsf@paduch.telenet.ru> References: <651F6603-F798-4381-929E-7D86A28DBC4D@gmail.com> <502464D6.4000103@gmail.com> <87wr1749m0.fsf@uwakimon.sk.tsukuba.ac.jp> <87r4rehd19.fsf@uwakimon.sk.tsukuba.ac.jp> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1344684667 18956 80.91.229.3 (11 Aug 2012 11:31:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 11 Aug 2012 11:31:07 +0000 (UTC) Cc: "Stephen J. Turnbull" , Vr Rm , Emacs development discussions To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Aug 11 13:31:06 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1T09uE-0006Ke-8C for ged-emacs-devel@m.gmane.org; Sat, 11 Aug 2012 13:30:58 +0200 Original-Received: from localhost ([::1]:44798 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T09uD-0003Sf-EY for ged-emacs-devel@m.gmane.org; Sat, 11 Aug 2012 07:30:57 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40951) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T09W3-0000YV-My for emacs-devel@gnu.org; Sat, 11 Aug 2012 07:06:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T09W1-00075Y-HO for emacs-devel@gnu.org; Sat, 11 Aug 2012 07:05:59 -0400 Original-Received: from mail-lpp01m010-f41.google.com ([209.85.215.41]:33176) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T09W1-00075N-AE for emacs-devel@gnu.org; Sat, 11 Aug 2012 07:05:57 -0400 Original-Received: by lahd3 with SMTP id d3so1292208lah.0 for ; Sat, 11 Aug 2012 04:05:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=YsM4v0xNBYsIQAOO1WDVVbM4fF/CeTngQQCFLdKj2xc=; b=NTmSY6tC7b213fRxS3fR7wdG6CR4NZzWl+34ATcnS1W2ydTeioQcx2vVWy0hM0Hqes ZBgrMP5WISTiRU0yDwXurn+mvic5k5wiYSgervVBs+CpJo4EjSS7xA4NzTfQHoaGox9X CYwQW3LXirc9PmuVAoP1TjmYHqG2K8upto1LFBy2gd2FYmryyb2zmv1W1PqgveZrOsr4 Ur4sCEeVlb+5kFoq6KOQ8ndwBG3/gtlg0SaS6kDim8CWr5IOJiPRozCTq4GfaAALEWeD 1qBQQmrbBKMH15o2x8e4bCHriKu+16QZ5JNWgtUPSvs6Y/cG0Ox0ShkQdxC7cMkbHrsp jo0g== Original-Received: by 10.112.102.10 with SMTP id fk10mr3567549lbb.39.1344683155647; Sat, 11 Aug 2012 04:05:55 -0700 (PDT) Original-Received: from paduch.telenet.ru ([46.48.49.226]) by mx.google.com with ESMTPS id sy1sm1514366lab.13.2012.08.11.04.05.54 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 11 Aug 2012 04:05:55 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Fri, 10 Aug 2012 14:50:20 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.215.41 X-Mailman-Approved-At: Sat, 11 Aug 2012 07:30:56 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:152434 Archived-At: Stefan Monnier: >>> And here we're back at regexps. I already agreed that they're >>> convenient for regexps, but pointed out that a better solution would be >>> to fix the regexp syntax so it doesn't backslash-escape every >>> special character. >> Yeah, I know -- I pointed that out too. That's still not a substitute >> for raw strings in code. SM> Why not? >> You still need to *double*-backslash-escape, backslash-escaping is >> insufficient. SM> If the special chars don't need to be backslash escaped, then you don't SM> need to double escape either, obviously. I like the Lua way of solving this problem. They use different characters for string and regexp escaping (\ and % correspondingly). Choosing the same character for both purposes really creates a huge opportunity for confusion, IMO. $ lua Lua 5.2.1 Copyright (C) 1994-2012 Lua.org, PUC-Rio > =string.find('-xyz-', '(%w+)') 2 4 xyz > But they also do not escape parentheses and have raw strings in the form of `[[...]]`. -- With best regards, Dmitri Paduchikh