220 36868 <58edbd0a-fb4c-48dd-8819-6fea7e9c8e39@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Todd Fleming <tbfleming@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: String interpolation
Date: Sun, 11 Feb 2018 07:45:18 -0800 (PST)
Lines: 93
Approved: news@gmane.org
Message-ID: <58edbd0a-fb4c-48dd-8819-6fea7e9c8e39@isocpp.org>
References: <356d5835-f1bf-4699-94f5-0b2d3d0b9c0e@isocpp.org>
 <CAMD6iD9aT26x8GQHnQL+kuj3Rq8fVQSfYYFtvTnFidkf6jU_ag@mail.gmail.com>
 <25CCF885-86AD-4D51-8F5C-C46376D34DE0@gmail.com> <4890431.TR9UepuQra@tjmaciei-mobl1>
 <CALvx3hac77b6Z=EOWzKqynALi1-352OvY0dnnOer8rN6tfa01g@mail.gmail.com> <1cdb6300-7397-46d7-bce9-62e6e8dac40b@isocpp.org>
 <CAC+0CCOSZHaTA=YPSDU8Add7mE_BYcYPRCmGW8TRPtZhdqL8Hw@mail.gmail.com>
 <4bce681e-e729-4124-9322-69291fdb6678@isocpp.org>
 <f5feb9a0-99d3-433a-ae46-af34c8d00a61@isocpp.org>
 <8e456af5-09c3-461d-8562-30df127e93af@isocpp.org>
 <bd24b702-025a-4b06-976b-559c779851e1@isocpp.org>
 <f63ed807-c5f6-4997-b03f-b4bc16a70982@isocpp.org>
 <28e80709-5ebb-44d2-b26d-22cafd681330@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_3856_886590181.1518363918199"
X-Trace: blaine.gmane.org 1518363823 404 195.159.176.226 (11 Feb 2018 15:43:43 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sun, 11 Feb 2018 15:43:43 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDN5JUVZSIFBBD6KQHKAKGQE4MNQB3I@isocpp.org Sun Feb 11 16:43:39 2018
Return-path: <std-proposals+bncBDN5JUVZSIFBBD6KQHKAKGQE4MNQB3I@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ua0-f197.google.com ([209.85.217.197])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDN5JUVZSIFBBD6KQHKAKGQE4MNQB3I@isocpp.org>)
	id 1ektmd-0006rt-HD
	for gclcip-std-proposals@m.gmane.org; Sun, 11 Feb 2018 16:43:15 +0100
Original-Received: by mail-ua0-f197.google.com with SMTP id z11sf8773584uaz.0
        for <gclcip-std-proposals@m.gmane.org>; Sun, 11 Feb 2018 07:45:21 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=aBbqzGF2RIMF19WTudcygGxGQKO9+k6Q1q+CvWCwDTQ=;
        b=wuN7BXzv9+5e7ucfR955SrPLIp/y6EOvaW4FjOL11UmbSGSM0Nl7HwfPBGYUOV48SD
         LrMOvNu7+hUbDDSno1GgZkmVpibPutHVHmLYsqT50DeZr3E4jfcS+l0eMNIREtX5qfs+
         NrTFLYTPndLTVi68/Ty5jANTOzqbDzifncKlgRURUOBko0E+r79JkOIgfawc5jYNQMXu
         CIcarZsKDmaFXfIe30zpj1Z2kJc7cFp5BoI7Ot/39nyUztKmI4iwIH9gtTArl6TQaZ/l
         3qqcVkXFkpwG8Uwpz0BDVyOCPpAAnI22Q2K2/7rS1rwAnFHDPBPw4pJ7d0ifARn9e/jV
         Hxzg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=aBbqzGF2RIMF19WTudcygGxGQKO9+k6Q1q+CvWCwDTQ=;
        b=TryJBSeYGh+qf0pPM6PdCAvIZ/mpnxdXzQiM6kgG6KXmJaAkKIy4adC/dhnALFJahP
         pZ8hkpbQtyNIABoLnLtl7Eo9A4r2ExnUxxoBjVQHgrqfD2ddQTpWnmDID+PcLO39vNOR
         zpHBr09D2nXw1kRDe43W/ylA7GePkv4achIVqPtZHjaHtKQAdiiU5f/RBAnheTbjn6z8
         8J4qL9SzJPTnnWTq7NwfidWNCq8rpjrfg2lijtuSyhOE5PMcoiCkO24H+yYTooroF/aR
         9JCWjrXFllhpsopN0/l0VFBSLDcXAtssc7ktXVTBfqUzhZsQTjC2lcsW1SMBHzl+f9LL
         EdRg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:from:to:message-id:in-reply-to:references
         :subject:mime-version:x-original-sender:reply-to:precedence
         :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe;
        bh=aBbqzGF2RIMF19WTudcygGxGQKO9+k6Q1q+CvWCwDTQ=;
        b=Oh+lohBi9etmaPa0K5yGDSj1ve/zlmjbiVo+QDypazA/g5RF4BJReQFVHdmJl7QsNR
         tgp8s/a0IzrKF5PNZ3KLM/7pkL2KN4PBEdY2wyMEZQ/gwQU4mRe7Yq1Ei8+Brb/LH+H4
         bVmms2eyZxFnDCDuXVOq4UCVamZPS8Zgtrv3SsVWwknDaGAU+H07qE68LXsCRhWYekXM
         9Htuy/h/ruJYYSZ2Cmsj9hfbUaZJCBojk3q5+Q5rN/qjCajLKlm8lOg/0llXrIXp+Oeq
         l790JliRWPgVQVTXRCnlJu8n345DquabLL6uEseHu451yWt1BWt6ZlCA5j8xkq7m2P3N
         wflw==
X-Gm-Message-State: APf1xPBVNLWdlUqx0CGqbK/Kifm+sta8hY1QsCGC+gudeSzP4qMNZMi0
	Q6V46Lz0btYO/rpwx2lldr2mww==
X-Google-Smtp-Source: AH8x225uuXysT6rTz1cz+D+slXwVi68oOJ+ni8s16QIU1IP6D/EqNRe3Ac6t+mZIyCq7pVPCfrODJQ==
X-Received: by 10.176.83.214 with SMTP id l22mr4808839uaa.44.1518363920517;
        Sun, 11 Feb 2018 07:45:20 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.31.178.134 with SMTP id b128ls5975050vkf.7.gmail; Sun, 11 Feb
 2018 07:45:19 -0800 (PST)
X-Received: by 10.31.158.65 with SMTP id h62mr795403vke.4.1518363918800;
        Sun, 11 Feb 2018 07:45:18 -0800 (PST)
In-Reply-To: <28e80709-5ebb-44d2-b26d-22cafd681330@isocpp.org>
X-Original-Sender: tbfleming@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:36868
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/36868>

------=_Part_3856_886590181.1518363918199
Content-Type: multipart/alternative; 
	boundary="----=_Part_3857_1412491744.1518363918200"

------=_Part_3857_1412491744.1518363918200
Content-Type: text/plain; charset="UTF-8"

On Sunday, February 11, 2018 at 3:35:50 AM UTC-5, Nicol Bolas wrote:
>
> For example, let's say I want to use interpolation to process a literal 
> and store all of the elements in a tuple. We can store each of the 
> non-literal parts easily enough. But what about the literal parts? You 
> might say that a `const char*` is good enough, but maybe I want it to be a 
> `string_view`. To do that with my system, it's as simple as:
>
> tuple(F"some string {variable} other string"sv);
>
> I have to write precisely *zero code* to make that work.
>

I'm starting to really love this idea. I've been racking my head on how to 
get lit-html <https://github.com/Polymer/lit-html>'s simplicity and 
expressiveness to C++ code compiled to wasm. The way this proposal is going 
I'd end up with something like this:

auto h = html(F"<div><h1>{title}</h1><p>{text}</p></div>"sv);

Todd

-- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/58edbd0a-fb4c-48dd-8819-6fea7e9c8e39%40isocpp.org.

------=_Part_3857_1412491744.1518363918200
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Sunday, February 11, 2018 at 3:35:50 AM UTC-5, Nicol Bo=
las wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left:=
 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><di=
v>For example, let&#39;s say I want to use interpolation to process a liter=
al and store all of the elements in a tuple. We can store each of the non-l=
iteral parts easily enough. But what about the literal parts? You might say=
 that a `const char*` is good enough, but maybe I want it to be a `string_v=
iew`. To do that with my system, it&#39;s as simple as:<br><br><div style=
=3D"background-color:rgb(250,250,250);border-color:rgb(187,187,187);border-=
style:solid;border-width:1px"><code><div><span style=3D"color:#000">tuple</=
span><span style=3D"color:#660">(</span><span style=3D"color:#000">F</span>=
<span style=3D"color:#080">&quot;some string {variable} other string&quot;<=
/span><span style=3D"color:#000">sv</span><span style=3D"color:#660">);</sp=
an></div></code></div><br>I have to write precisely <i>zero code</i> to mak=
e that work.<br></div></div></blockquote><div><br></div><div>I&#39;m starti=
ng to really love this idea. I&#39;ve been racking my head on how to get=C2=
=A0<a href=3D"https://github.com/Polymer/lit-html">lit-html</a>&#39;s simpl=
icity and expressiveness to C++ code compiled to wasm. The way this proposa=
l is going I&#39;d end up with something like this:</div><div><br></div><di=
v><div class=3D"prettyprint" style=3D"background-color: rgb(250, 250, 250);=
 border-color: rgb(187, 187, 187); border-style: solid; border-width: 1px; =
word-wrap: break-word;"><code class=3D"prettyprint"><div class=3D"subpretty=
print"><font color=3D"#660066"><span style=3D"color: #008;" class=3D"styled=
-by-prettify">auto</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify"> h </span><span style=3D"color: #660;" class=3D"styled-by-prettify"=
>=3D</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> html<=
/span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify">F</span><span style=
=3D"color: #080;" class=3D"styled-by-prettify">&quot;&lt;div&gt;&lt;h1&gt;{=
title}&lt;/h1&gt;&lt;p&gt;{text}&lt;/p&gt;&lt;/div&gt;&quot;</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify">sv</span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">);</span></font></div></code></di=
v><br>Todd</div><div><br></div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/58edbd0a-fb4c-48dd-8819-6fea7e9c8e39%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/58edbd0a-fb4c-48dd-8819-6fea7e9c8e39=
%40isocpp.org</a>.<br />

------=_Part_3857_1412491744.1518363918200--

------=_Part_3856_886590181.1518363918199--

.
