220 20508 <55FDC8F9.9050909@wanadoo.fr> article
Path: news.gmane.org!not-for-mail
From: "Vicente J. Botet Escriba" <vicente.botet@wanadoo.fr>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Rough Draft Proposal of Interpolated String Literals
Date: Sat, 19 Sep 2015 22:43:37 +0200
Lines: 58
Approved: news@gmane.org
Message-ID: <55FDC8F9.9050909@wanadoo.fr>
References: <CAB+4KHKxwEPXSFScU-FjeUL=yQFZWGfm6uk5fbh1+9bfScL_2Q@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable
X-Trace: ger.gmane.org 1442695438 20638 80.91.229.3 (19 Sep 2015 20:43:58 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sat, 19 Sep 2015 20:43:58 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDH67CONY4PBB6UR66XQKGQE4VH46RI@isocpp.org Sat Sep 19 22:43:44 2015
Return-path: <std-proposals+bncBDH67CONY4PBB6UR66XQKGQE4VH46RI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-la0-f70.google.com ([209.85.215.70])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDH67CONY4PBB6UR66XQKGQE4VH46RI@isocpp.org>)
	id 1ZdOyy-00041M-Dh
	for gclcip-std-proposals@m.gmane.org; Sat, 19 Sep 2015 22:43:40 +0200
Original-Received: by lagj9 with SMTP id j9sf31001335lag.0
        for <gclcip-std-proposals@m.gmane.org>; Sat, 19 Sep 2015 13:43:39 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:subject:to:references:from:message-id:date
         :user-agent:mime-version:in-reply-to:content-type
         :content-transfer-encoding:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=od6JkmsCxL7tF5MSbxzapYu+/4UcAw+7AR4xtFhZ4L4=;
        b=VoiNdYa9DOFgP240g0SHWFvT75+Y+cfHmf+z7WfAcXDYHHDpckN+EIp3913G9Pshnw
         8O1PQvVQYOUnIRlQDzbtOChg//JnYNSCt1b17NvNxOu32AJHbJNj9fps/2MjC6DL+hpx
         Pp9THH9BLGyL8+fgq1ua1jRKztTVFZ88qDsg4fk0kFNa6MftEaoOhYX+Vqk91u0QG1YK
         KqWhqReucpRdKhln5ru7wWfvfzKqj/mBeDt2XKktbJdv5WuoQ/HrHHBZSVzPsAR8ZIae
         or8gpf5Tzs1+BSM2z6elFHVsI9b4BdUzHB6ERlzAkR2mKDn 
X-Gm-Message-State: ALoCoQkmdRjRT6+QbGZLkq9IiCWWg87dODJ+nR18OhjGEArf0sGF7iUhb9PNwnnxqKWX+GWRzibR
X-Received: by 10.152.37.161 with SMTP id z1mr410314laj.8.1442695419701;
        Sat, 19 Sep 2015 13:43:39 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.180.10.97 with SMTP id h1ls422658wib.26.gmail; Sat, 19 Sep
 2015 13:43:38 -0700 (PDT)
X-Received: by 10.180.89.99 with SMTP id bn3mr4724944wib.61.1442695418398;
        Sat, 19 Sep 2015 13:43:38 -0700 (PDT)
Original-Received: from smtp.smtpout.orange.fr (smtp09.smtpout.orange.fr. [80.12.242.131])
        by mx.google.com with ESMTPS id g17si20563361wjz.119.2015.09.19.13.43.38
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=RC4-SHA bits=128/128);
        Sat, 19 Sep 2015 13:43:38 -0700 (PDT)
Received-SPF: neutral (google.com: 80.12.242.131 is neither permitted nor denied by best guess record for domain of vicente.botet@wanadoo.fr) client-ip=80.12.242.131;
Original-Received: from new-host.home ([2.11.255.5])
	by mwinf5d17 with ME
	id K8jd1r00707lkcJ038jdRs; Sat, 19 Sep 2015 22:43:38 +0200
X-ME-Helo: new-host.home
X-ME-Auth: dmljZW50ZS5ib3RldEB3YW5hZG9vLmZy
X-ME-Date: Sat, 19 Sep 2015 22:43:38 +0200
X-ME-IP: 2.11.255.5
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:38.0)
 Gecko/20100101 Thunderbird/38.2.0
In-Reply-To: <CAB+4KHKxwEPXSFScU-FjeUL=yQFZWGfm6uk5fbh1+9bfScL_2Q@mail.gmail.com>
X-Original-Sender: vicente.botet@wanadoo.fr
X-Original-Authentication-Results: mx.google.com;       spf=neutral
 (google.com: 80.12.242.131 is neither permitted nor denied by best guess
 record for domain of vicente.botet@wanadoo.fr) smtp.mailfrom=vicente.botet@wanadoo.fr
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: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://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>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:20508
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/20508>

Le 18/09/15 22:21, Andrew Tomazos a =C3=A9crit :
> Please find attached a very very rough draft of a proposal entitled
> "Interpolated String Literals".
>
> Mainly after encouragement or discouragement, and any high-level thoughts
> you might have about it.
>
I like the idea. IIUC the interpolated string

     F"$ This is $i and this is $s."

you are proposing is syntactic sugar for

     << "This is " << i << " and this is " << s << "."

The transformation has the advantage that the result is already parsed.

However, if we want to manage with internationalization I believe that=20
the whole interpolated string should be translated to something like

     format(translate("This is {1} and this is {2}."), i, u);

Where translate takes care of the internationalization, it would lookup=20
for the translation "This is %1% and this is %2%." in its dictionary.
format is a variadic variant of Boost.Format, which could be more=20
efficient than the use of % as in ,

     format(translate("This is {1} and this is {2}.")) % i % u;

This is the schema used by Boost.Locale. IMO any internationalization=20
solution must pay at run time for the look-up and the parsing.

Why not have both using two different prefixes for two different=20
translation schemes?

     I"$ This is $i and this is $s."

I recognize that a internationalization solution is more complex than=20
what you proposes and need much more than that. Your proposal has enough=20
value by itself, and could be adapted later if one day we have an=20
internationalization proposal.

Vicente

P.S. As others, I don't think it is correct  to have the fist << in the=20
translation, the translation should result in one expression.

--=20

---=20
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 e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

.
