From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Matthew Plant Newsgroups: gmane.emacs.devel Subject: Re: Raw string literals in Emacs lisp. Date: Wed, 30 Jul 2014 14:01:52 -0700 Message-ID: References: <878ungor1v.fsf@uwakimon.sk.tsukuba.ac.jp> <8761ijng08.fsf@uwakimon.sk.tsukuba.ac.jp> <871tt7lzro.fsf@fencepost.gnu.org> <53D567FD.4030708@porkrind.org> <87r412iobp.fsf@lifelogs.com> <53D9586F.6020705@porkrind.org> <87bns6in3g.fsf@lifelogs.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c383bc293c7104ff6f7786 X-Trace: ger.gmane.org 1406754135 11761 80.91.229.3 (30 Jul 2014 21:02:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 30 Jul 2014 21:02:15 +0000 (UTC) To: "emacs-devel@gnu.org" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 30 23:02:08 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 1XCb0g-0004Vd-1u for ged-emacs-devel@m.gmane.org; Wed, 30 Jul 2014 23:02:06 +0200 Original-Received: from localhost ([::1]:53185 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCb0f-00021Y-KV for ged-emacs-devel@m.gmane.org; Wed, 30 Jul 2014 17:02:05 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47295) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCb0Y-0001w9-9J for emacs-devel@gnu.org; Wed, 30 Jul 2014 17:02:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XCb0T-0004iQ-VM for emacs-devel@gnu.org; Wed, 30 Jul 2014 17:01:58 -0400 Original-Received: from mail-la0-f49.google.com ([209.85.215.49]:47302) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCb0T-0004hR-L2 for emacs-devel@gnu.org; Wed, 30 Jul 2014 17:01:53 -0400 Original-Received: by mail-la0-f49.google.com with SMTP id hz20so1345270lab.22 for ; Wed, 30 Jul 2014 14:01:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=juaukk0FGQxYG5TPaZQ7be4f2BBf/gji8G9AIGEqEFk=; b=aV5I6s+ShwWrI53qpdRe93jpxayv1LGvtemCSECKXOR0EiVD8eJXgl1SXxKHY94eJR p24+Jo5nqcedaTJSzcawPMdlrSlcuGLBZ4Lbhe0yxSF3xFLlfyVpvrYGEFJks2frOBH4 6B0hNpgJ/26wufiSaScZjL0uWZ9NPPU/mV6x5QcD8ICmiVOXsuxJtO8zSTuUUp8z4rXf RdpSH8S0A8B1ttuS+7vYCBlAzbXVS0FMwcduGDe53ssKhbnddZnjdKrCMnjzjbSf5g6Z 3bOQzqzXOSKyhf/slyt4Ju3ryqIBhfWnZCaxvSAGXn4NqiA/LCPgR5wwWHVlUUIFjZrw i0dg== X-Gm-Message-State: ALoCoQnHabAJ6qDqFgvNxBYE3ZCEi1vwb5FBx62Hm/FJhGRdJQ1O3EyaDM+h2Ag/KTBW4t/BfJSO X-Received: by 10.112.166.2 with SMTP id zc2mr7130758lbb.98.1406754112482; Wed, 30 Jul 2014 14:01:52 -0700 (PDT) Original-Received: by 10.112.185.99 with HTTP; Wed, 30 Jul 2014 14:01:52 -0700 (PDT) In-Reply-To: <87bns6in3g.fsf@lifelogs.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.215.49 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:173301 Archived-At: --001a11c383bc293c7104ff6f7786 Content-Type: text/plain; charset=UTF-8 > How about using a Unicode character as the marker? (prepares for stoning) I'm on the fence about this idea. It certainly would make parsing in reverse possible (assuming the reverse parsing functions do not operate on char *) and easy, but it would also possibly mess up formatting. It also might not add much convenience because frankly typing non-unicode characters is _hard_. One suggestion would be to use the unicode left and right double/single quotation marks. On Wed, Jul 30, 2014 at 1:54 PM, Ted Zlatanov wrote: > On Wed, 30 Jul 2014 13:41:19 -0700 David Caldwell > wrote: > > DC> On 7/30/14 1:28 PM, Ted Zlatanov wrote: > >> On Sun, 27 Jul 2014 13:58:37 -0700 David Caldwell > wrote: > >> > DC> Why not, then, skip rawstrings completely and go directly to a regular > DC> expression reader: #r// (or even just #//) instead of #r""? > >> > >> For shell commands, for instance, it would be convenient to have > >> rawstrings because they often have internal backslash escapes. > > DC> That's precisely the point I made later in my email > > Sorry I didn't see it. > > DC> rawstrings used in shell don't want things like \n escaped, but > DC> regexps do (otherwise you have to add "\n" literal support to the > DC> regexp engine). There's 2 usages with competing semantics trying to > DC> use one generic interface. I still posit that having a syntax > DC> directly for regexps would be beneficial. And I think focusing on > DC> regexps is more important in Emacs as it happens more than > DC> complicated shell commands. > > Heredocs are generally useful and popular and would also be supported by > this syntax. But please don't take that as a knock against regexp > literal support, it's just not something I have needed. > > DC> Sadly it sounds like a the #r// would be a no-go due to the Emacs > DC> requirements of parsing it in reverse (I assume because '/' is a valid > DC> lisp symbol character). > > I have no opinion on that, I just want a simple syntax for literal data :) > > How about using a Unicode character as the marker? (prepares for stoning) > > Ted > > > --001a11c383bc293c7104ff6f7786 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
>=20 How about using a Unicode character as the marker? (prepares for stoning)
I'm on the fence about this idea. It certainly would make = parsing in reverse possible (assuming the reverse parsing functions do not = operate on char *) and easy, but it would also possibly mess up formatting.= It also might not add much convenience because frankly typing non-unicode = characters is _hard_.

=C2=A0One suggestion would be to use the unicode left and ri= ght double/single quotation marks.


On Wed, Jul 30, 2014 at 1:54 PM, Ted Z= latanov <tzz@lifelogs.com> wrote:
On Wed, 30 Jul 2014 13:41:19 -0700 David Cal= dwell <david@porkrind.org> = wrote:

DC> On 7/30/14 1:28 PM, Ted Zlatanov wrote:
>> On Sun, 27 Jul 2014 13:58:37 -0700 David Caldwell <david@porkrind.org> wrote:
>>
DC> Why not, then, skip rawstrings completely and go directly to a regul= ar
DC> expression reader: #r// (or even just #//) instead of #r""= ?
>>
>> For shell commands, for instance, it would be convenient to have >> rawstrings because they often have internal backslash escapes.

DC> That's precisely the point I made later in my email

Sorry I didn't see it.

DC> rawstrings used in shell don't want things like \n escaped, but<= br> DC> regexps do (otherwise you have to add "\n" literal support= to the
DC> regexp engine). There's 2 usages with competing semantics trying= to
DC> use one generic interface. I still posit that having a syntax
DC> directly for regexps would be beneficial. And I think focusing on DC> regexps is more important in Emacs as it happens more than
DC> complicated shell commands.

Heredocs are generally useful and popular and would also be supported by this syntax. =C2=A0But please don't take that as a knock against regexp=
literal support, it's just not something I have needed.

DC> Sadly it sounds like a the #r// would be a no-go due to the Emacs DC> requirements of parsing it in reverse (I assume because '/' = is a valid
DC> lisp symbol character).

I have no opinion on that, I just want a simple syntax for literal data :)<= br>
How about using a Unicode character as the marker? (prepares for stoning)
Ted



--001a11c383bc293c7104ff6f7786--