220 31930 <CAOfiQqkRjs1jkgVrXLM8HA+XbkTJQ8oBoZh9XneTPCgB4AK7GQ@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Richard Smith <richard@metafoo.co.uk>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: This variable should not be named: an identifier
 (not) to remember
Date: Sun, 2 Apr 2017 13:10:14 -0700
Lines: 114
Approved: news@gmane.org
Message-ID: <CAOfiQqkRjs1jkgVrXLM8HA+XbkTJQ8oBoZh9XneTPCgB4AK7GQ@mail.gmail.com>
References: <985b9b2a-c734-45eb-95f4-db4dc0d309a1@isocpp.org>
 <CAOfiQqnfaqA4YhpNphKg4oPPAMNOe7vPjqxqLvA-EnGjk-pVEA@mail.gmail.com>
 <1491170458.9U0G8TLsOk@tjmaciei-mobl1> <170CB823-B63F-4910-A227-95C23314ADAD@gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=f403045cf79abbadda054c34a220
X-Trace: blaine.gmane.org 1491163836 8259 195.159.176.226 (2 Apr 2017 20:10:36 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sun, 2 Apr 2017 20:10:36 +0000 (UTC)
To: "std-proposals@isocpp.org" <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDVNBJG4YAIBBPFVQXDQKGQEQMD36QI@isocpp.org Sun Apr 02 22:10:32 2017
Return-path: <std-proposals+bncBDVNBJG4YAIBBPFVQXDQKGQEQMD36QI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lf0-f72.google.com ([209.85.215.72])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDVNBJG4YAIBBPFVQXDQKGQEQMD36QI@isocpp.org>)
	id 1culpX-0001ap-M3
	for gclcip-std-proposals@m.gmane.org; Sun, 02 Apr 2017 22:10:31 +0200
Original-Received: by mail-lf0-f72.google.com with SMTP id x137sf24411735lff.3
        for <gclcip-std-proposals@m.gmane.org>; Sun, 02 Apr 2017 13:10:37 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:sender:in-reply-to:references:from
         :date:message-id:subject:to: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=1O42HEE1rb2ub9Kwl9Z075yaWDlElmLswl0Pkr4RnKI=;
        b=Wj5FvrY2g9j3VgrHl93MSTahicywx1A5U31wnpvB1JIsFJEo/+IaegTVrc2hgZ06Vc
         SCd9v/VifQFnXzVaLUglRlwQ1CxC9/eZyPQ6jVhPlRpY9GeTm9wccgenKCmxdS9vsqYh
         KCoFvCG8fKpT8B5NIHelcPf/srMlen5RJD4u/xy00pTz8bgLTg6EYdpjQ1NesGrp9cpZ
         YxXwtBTMBDyayg1X1KtqK6tB6v6cuaJCE8EFdjPVmf1N8s62qlyxry2YzFyuVFHrUHrG
         +Kt739tuFiWMPpDrPnLbyRnFGQKhpRW2x/h+R7G8IOK9RZdRATDHlY0sQo0WG8eo+a9r
         zzAQ==
X-Gm-Message-State: AFeK/H2rHil4X31VRGIDdYzRmgWYkFHw3+Rax/7KmKb5AiclbQlzE0C8NFX5e1mOQF3EYA==
X-Received: by 10.25.235.21 with SMTP id j21mr1810658lfh.10.1491163837765;
        Sun, 02 Apr 2017 13:10:37 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.28.184.4 with SMTP id i4ls556779wmf.21.gmail; Sun, 02 Apr 2017
 13:10:36 -0700 (PDT)
X-Received: by 10.28.195.214 with SMTP id t205mr6356582wmf.104.1491163836313;
        Sun, 02 Apr 2017 13:10:36 -0700 (PDT)
Original-Received: from mail-wr0-x230.google.com (mail-wr0-x230.google.com. [2a00:1450:400c:c0c::230])
        by mx.google.com with ESMTPS id e2si17044233wrc.122.2017.04.02.13.10.36
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Sun, 02 Apr 2017 13:10:36 -0700 (PDT)
Received-SPF: pass (google.com: domain of metafoo@gmail.com designates 2a00:1450:400c:c0c::230 as permitted sender) client-ip=2a00:1450:400c:c0c::230;
Original-Received: by mail-wr0-x230.google.com with SMTP id w43so142462242wrb.0
        for <std-proposals@isocpp.org>; Sun, 02 Apr 2017 13:10:36 -0700 (PDT)
X-Received: by 10.223.178.182 with SMTP id g51mr11531392wrd.12.1491163835770;
 Sun, 02 Apr 2017 13:10:35 -0700 (PDT)
Original-Sender: metafoo@gmail.com
Original-Received: by 10.80.148.82 with HTTP; Sun, 2 Apr 2017 13:10:14 -0700 (PDT)
In-Reply-To: <170CB823-B63F-4910-A227-95C23314ADAD@gmail.com>
X-Original-Sender: richard@metafoo.co.uk
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com;       spf=pass (google.com: domain of metafoo@gmail.com
 designates 2a00:1450:400c:c0c::230 as permitted sender) smtp.mailfrom=metafoo@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <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:31930
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/31930>

--f403045cf79abbadda054c34a220
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On 2 April 2017 at 12:56, Alberto Barbati <albertobarbati@gmail.com> wrote:

> Il giorno 02 apr 2017, alle ore 20:03, Thiago Macieira <
> thiago@macieira.org> ha scritto:
>
> >> On s=C3=A1bado, 1 de abril de 2017 21:19:37 PDT Richard Smith wrote:
> >> Have you considered that possibility? It would give a better name (_
> rather
> >> than __) and avoid "breaking" existing code that uses __.
> >
> > _ is not reserved to the compiler and is VERY often #defined to gettext=
..
>
> Thank you Richard for your suggestion which is very interesting, since it
> provides good insights about a possible wording. As for the name, I belie=
ve
> Thiago and Magnus raised valid concerns, though. It's true that the we
> might choose _ without breaking existing code. However defining _ as a
> macro is currently valid and apparently widely used. I believe we therefo=
re
> have only two choices: either we make such uses undefined behavior
> (upsetting a lot of people) or we choose wording to avoid that (making th=
e
> feature essentially unusable for users of all libraries like gettext). No=
ne
> of the two approaches seems very good. Is there a third option?
>

As noted, gettext defines _ as a function-like macro, so there seems to be
no technical problem for users of gettext (although some might consider
overloading the meaning of _ in this way to be a readability problem).

__ seems somewhat safer and less controversial.


I would expect you'll find controversy if you pick a worse name in order to
avoid collision with a macro name that some would already consider to be
poorly chosen, so I don't think it's clear which will be less controversial=
..

--=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.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/CAOfiQqkRjs1jkgVrXLM8HA%2BXbkTJQ8oBoZh9XneTPCgB4=
AK7GQ%40mail.gmail.com.

--f403045cf79abbadda054c34a220
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On 2=
 April 2017 at 12:56, Alberto Barbati <span dir=3D"ltr">&lt;<a href=3D"mail=
to:albertobarbati@gmail.com" target=3D"_blank">albertobarbati@gmail.com</a>=
&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0=
 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>Il giorno 02 apr=
 2017, alle ore 20:03, Thiago Macieira &lt;<a href=3D"mailto:thiago@macieir=
a.org" target=3D"_blank">thiago@macieira.org</a>&gt; ha scritto:<br>
<br>
&gt;&gt; On s=C3=A1bado, 1 de abril de 2017 21:19:37 PDT Richard Smith wrot=
e:<br>
&gt;&gt; Have you considered that possibility? It would give a better name =
(_ rather<br>
&gt;&gt; than __) and avoid &quot;breaking&quot; existing code that uses __=
..<br>
&gt;<br>
&gt; _ is not reserved to the compiler and is VERY often #defined to gettex=
t.<br>
<br>
</span>Thank you Richard for your suggestion which is very interesting, sin=
ce it provides good insights about a possible wording. As for the name, I b=
elieve Thiago and Magnus raised valid concerns, though. It&#39;s true that =
the we might choose _ without breaking existing code. However defining _ as=
 a macro is currently valid and apparently widely used. I believe we theref=
ore have only two choices: either we make such uses undefined behavior (ups=
etting a lot of people) or we choose wording to avoid that (making the feat=
ure essentially unusable for users of all libraries like gettext). None of =
the two approaches seems very good. Is there a third option?<br></blockquot=
e><div><br></div><div>As noted, gettext defines _ as a function-like macro,=
 so there seems to be no technical problem for users of gettext (although s=
ome might consider overloading the meaning of _ in this way to be a readabi=
lity problem).</div><div><br></div><blockquote class=3D"gmail_quote" style=
=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
__ seems somewhat safer and less controversial.</blockquote><div><br></div>=
<div>I would expect you&#39;ll find controversy if you pick a worse name in=
 order to avoid collision with a macro name that some would already conside=
r to be poorly chosen, so I don&#39;t think it&#39;s clear which will be le=
ss controversial.</div></div></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/CAOfiQqkRjs1jkgVrXLM8HA%2BXbkTJQ8oBoZ=
h9XneTPCgB4AK7GQ%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAOfiQqkRjs1jkg=
VrXLM8HA%2BXbkTJQ8oBoZh9XneTPCgB4AK7GQ%40mail.gmail.com</a>.<br />

--f403045cf79abbadda054c34a220--

.
