From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Magne Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: Regexps and strings once again Date: Mon, 15 Sep 2014 12:04:55 +0200 Message-ID: References: <541637C4.8050502@dancol.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1410775551 25901 80.91.229.3 (15 Sep 2014 10:05:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 15 Sep 2014 10:05:51 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 15 12:05:46 2014 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 1XTTAF-0000rt-L1 for ged-emacs-devel@m.gmane.org; Mon, 15 Sep 2014 12:05:43 +0200 Original-Received: from localhost ([::1]:58346 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTTAF-0006vj-7P for ged-emacs-devel@m.gmane.org; Mon, 15 Sep 2014 06:05:43 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41477) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTTA3-0006vY-JK for emacs-devel@gnu.org; Mon, 15 Sep 2014 06:05:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XTT9y-00037j-8v for emacs-devel@gnu.org; Mon, 15 Sep 2014 06:05:31 -0400 Original-Received: from hermes.netfonds.no ([80.91.224.195]:39138) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTT9y-00037O-2k for emacs-devel@gnu.org; Mon, 15 Sep 2014 06:05:26 -0400 Original-Received: from cm-84.215.51.58.getinternet.no ([84.215.51.58] helo=stories.gnus.org) by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1XTT9T-0002mV-Hb; Mon, 15 Sep 2014 12:04:55 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAMFBMVEX89eC4qppQSkvs3sn+ /ev9+ub///Xf0b7///P269b+/vF7cWnQwK/+//OdkYMjIim6GsXAAAACJElEQVQ4jW2QvasTQRTF b2FA7bayCSm2XTDCFCGdxQQlVYoMGrFe1te+YhFSShgWhEAa0+c91yks0i4IqV4zvE772Aa2yB/w 4rkz+5Goh2Vm9/zuuXdmiZSSJteLODax17ckybOMqDOVY8PgNm6kNYCavvGJVslCa6KZfGXMJYgT BmrKM/QFWHArmsrLVj/zRBtDLjLO9WNYH35h+fxUGmM2FTBV6DaJ9VsBfwTwiCuytlvyzmzkyN3D 3LzWur0GJswYKHTCsepzXQFsXkpqzlsTnWGEVLRkgMxXJjwmy9hXtF7yb5Tm+xftlY2lHKkJgw5n bnLvJz4AwOPfI2Iy/ckhg0RnUrfiuxiMzXMDoHwrUjNZIRZup3DY9ZqWHZdpxP4TAEToHCn21zSs gRqxCRuDuY+oI8wmihf2VySGnrwgpw5xn5UQlF4LgZTTR7/BFindVSSFM2zAICV7l6apEG1sLcT1 IAWwlskzx1ZDt4nUgSZSC/WprRI8Z9D6c2sp6HoE6KmrtzsKAuu7nQnOHsBnGjZHHxsEtAfhUNVv zuXwAyqZ2K49030Q9PZUlmWV2VnPdz18l1SUFeri2QVesDwoe72gVa90oPhR1iFXunefBUVFUTPo UG1FQSEIdt+x/P3A1SyKtmHoMgeuPjx3bhFGFDr/H4UMWFHhhrl1ywadoPDk6TZyHpY+g2P4H/Vd 4nQ8YumjznnsVIDfjvVb6NYG/K0/m5kZZkBjMegAAAAASUVORK5CYII= X-Now-Playing: On's _Your Naked Ghost Comes Back at Night_: =?iso-8859-1?Q?=22Fa=E7ade=22?= X-Hashcash: 1:23:140915:dancol@dancol.org::BcIfwHIod/WWRWhH:0000000000000000000000000000000000000000000045L1 X-Hashcash: 1:23:140915:emacs-devel@gnu.org::DMG2F9GX53rFyBrH:0000000000000000000000000000000000000000007Kpl X-Hashcash: 1:23:140915:monnier@iro.umontreal.ca::1QC+3dz8Umdb4Mio:0000000000000000000000000000000000000pMcb In-Reply-To: (Stefan Monnier's message of "Sun, 14 Sep 2014 22:14:31 -0400") User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.4.50 (gnu/linux) X-MailScanner-ID: 1XTT9T-0002mV-Hb MailScanner-NULL-Check: 1411380298.53179@SHxgGKrUqmA9k0odl4HyEw X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.224.195 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:174313 Archived-At: Stefan Monnier writes: >> On 09/14/2014 04:27 PM, Lars Magne Ingebrigtsen wrote: >>> (dom-by-id dom (regexp "I \\(couldn't\\)?haz new syntax")) > > `regexp' could just as well take a new syntax. Sure, it could take Perl regexps, but having the argument not be a string would be a stretch, wouldn't it? If we want to do a more string-ey syntax, but not require wrapping it in (regexp ...), then we could have something like: #r"This is (not )?a Perl regexp" for regexp literals. Quoting " characters would still be necessary, but I don't think that's all that important. (And quoting quote chars is less annoying than quoting slashes.) If you're constructing the regexp from strings, you'd need the `regexp' call to turn it into a regexp object. I kinda envision all the functions that currently have a regexp option, or a regexp version, to also take a regexp object, no matter how it's defined. Like `search-forward'/`re-search-forward'... And this could be done gradually once we've introduced the regexp object type, so it doesn't seem like an insurmountable change, if somebody wanted to work on this... -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no