220 11478 <97dfc150-6ae5-4494-bed5-3f4f5fed84fa@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Matthew Fioravante <fmatthew5876@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Named function parameters using anonymous structs
 for C and C++
Date: Tue, 17 Jun 2014 08:52:48 -0700 (PDT)
Lines: 178
Approved: news@gmane.org
Message-ID: <97dfc150-6ae5-4494-bed5-3f4f5fed84fa@isocpp.org>
References: <72c49240-547b-4bf6-8b27-aff6a61c1272@isocpp.org> <cb957c9d-f151-4cdb-b749-c3e158d72e3c@isocpp.org> <ea5e7788-1c8f-43e6-9486-5fec31b22166@isocpp.org> <ce610dc2-be04-4f15-813b-f8aaa55aab63@isocpp.org> <D251F8E8-26EA-46C8-A6FC-877748BB4E46@gmail.com> <36D3B24B-7F24-4ED5-A27C-F4EF71CF244C@gmail.com> <a36b1035-fabd-402f-9817-498acd56e614@isocpp.org> <29C6D83B-BD31-42A9-B7BD-2C797E3FE58C@gmail.com> <b244aedd-5d7b-494b-a192-995059a831d2@isocpp.org> <0bf9fa1c-db92-4f3c-bb2f-627e8b4e6135@isocpp.org>
 <671A8CDD-7805-410F-94A0-62DEBD78D1C0@gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_457_19075104.1403020369085"
X-Trace: ger.gmane.org 1403020381 1881 80.91.229.3 (17 Jun 2014 15:53:01 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 17 Jun 2014 15:53:01 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDELF54RTIGRBUWIQGOQKGQESWHZN5A@isocpp.org Tue Jun 17 17:52:55 2014
Return-path: <std-proposals+bncBDELF54RTIGRBUWIQGOQKGQESWHZN5A@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qa0-f72.google.com ([209.85.216.72])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDELF54RTIGRBUWIQGOQKGQESWHZN5A@isocpp.org>)
	id 1Wwvgp-0001cW-Rs
	for gclcip-std-proposals@m.gmane.org; Tue, 17 Jun 2014 17:52:52 +0200
Original-Received: by mail-qa0-f72.google.com with SMTP id i13sf22806384qae.3
        for <gclcip-std-proposals@m.gmane.org>; Tue, 17 Jun 2014 08:52:51 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        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
         :content-type;
        bh=P2B0QT8grtlmK+iaeudZGMVfgV4Wgq0oSTkezdprZjk=;
        b=blnP0+ogY7TwEEHmscK/71r9A4VhY2tskY/dETwi1X+P230snlOvBx48f4Vx6XJGQp
         enirzTMLdyQlBLbgu9oM7KmJGd7ehz6iZmM+L/e1BStuphOGSdRlXmggkslDJd/f7hcj
         pM/Bprok/boLNBwFd5teSOtO3ENXsGxU0y+FGwdtpsOdVOrk39azbwpnofjoE+1eWGDH
         jbStbZlkmOE8jGmkfCEy1dIO/WzibkRd2IdBfxl14b8aIDPVii4WhwDqkjEiF26f2CbC
         5OtxOo/QyDhGime+gbCNBoW6qf/nir2lS58P8Mj7nVXQ1l14eUiksRjVhrzKES0bh1t/
         I6PQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        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:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe:content-type;
        bh=P2B0QT8grtlmK+iaeudZGMVfgV4Wgq0oSTkezdprZjk=;
        b=Gaj4weHBCIjdhb6O/yy+vqWZxHOnRJO0zKo8EOC1n+HDwYW+Vrwp1Mv2RldKQsAE0s
         EXyjqi7o/VkkGsbtWbe7nXwEAbJmG5DdJUPYYVqnTQ7AzpuoibUfANP7rvxPiAUI27H6
         dcNZvuGSJa1pS2CCJj7PJvi6j6XGdcv9rZ9hLFUVRAjVJ+qP1E1z6pViWFXlJuHVQ01V
         80MmRKZzMO1C2ojuof65qA9aJSPzgHW+CBWcU9zSYlXKCKIhVMXfDWeEssksxcXXwTm/
         HKaGmtGsNvBWT03keB1T8uBH6nx7sPc1OD8YFm0m/vqLZxCvF0VqHGeNyjEpn3zpagaS
         mo3g==
X-Gm-Message-State: ALoCoQkqJc30pfxTuhtseuaasxB54bXqK3dDD0mjpPlb/5Ef4D/uREepfDG0KNpdEyUO5Aqi0RGY
X-Received: by 10.58.65.38 with SMTP id u6mr576784ves.16.1403020371082;
        Tue, 17 Jun 2014 08:52:51 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.38.133 with SMTP id t5ls4871015qgt.43.gmail; Tue, 17 Jun
 2014 08:52:50 -0700 (PDT)
X-Received: by 10.140.92.77 with SMTP id a71mr484783qge.0.1403020370408;
        Tue, 17 Jun 2014 08:52:50 -0700 (PDT)
In-Reply-To: <671A8CDD-7805-410F-94A0-62DEBD78D1C0@gmail.com>
X-Original-Sender: fmatthew5876@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: <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: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:11478
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/11478>

------=_Part_457_19075104.1403020369085
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable



On Tuesday, June 17, 2014 11:21:51 AM UTC-4, David Krauss wrote:
>
>
> On 2014=E2=80=9306=E2=80=9317, at 10:59 PM, Matthew Fioravante <fmatth...=
@gmail.com=20
> <javascript:>> wrote:
>
> As I'm working on the paper and thinking about the details of the=20
> proposal, I've found a few issues to wrestle with.
>
> The major difference between aggregate initialization and a set of what I=
=20
> call in the paper compiler generated "aggregate member constructors":
>
> Aggregates can be left in an uninitialized state by not specifying an=20
> initializer. If we drop aggregate initialization in favor of constructors=
,=20
> we still need to support this behavior.
>
>
> Who is =E2=80=9Cwe=E2=80=9D? Surely you don=E2=80=99t mean dropping it fr=
om the standard, but=20
> you=E2=80=99re just considering the case when the user is migrating a cla=
ss from=20
> from aggregate to constructor?
>
> Hmm. Checking the draft:
>
> First, this syntax is yet another *special case* inherited for C=20
> compatibility. These compatibility cases complicate the standard and the=
=20
> learning curve for C++ developers. It would be better if this feature cou=
ld=20
> be reimplemented using already existing C++ rules and mechanisms and stil=
l=20
> retain C compatibility.
>
> This seems to be veering away from the problem statement. =E2=80=9CNewer =
would be=20
> better=E2=80=9D is not much of a motivation. You need to clearly state wh=
at=E2=80=99s=20
> broken before going down this path. For what it=E2=80=99s worth, aggregat=
e=20
> initialization has been maintained just as carefully as the rest of the=
=20
> language.
>

The idea is that if aggregate initialization for class types can be=20
completely reproduced by compiler generated constructors, we don't actually=
=20
need it. This is a side question and not too important.=20

>
> Named function parameters using structs chicken and egg problem:
>
> If we had named function params, aka:
>
> int foo(int a, int b, int c);
> foo(.a =3D 1, .b =3D 2, .c =3D 4);
>
> Then having designated initializers for structs would just fall out from=
=20
> this in the constructors.
>
> If we introduce designated initializers first, then named function=20
> parameters are derived from that. I'm falling more and more into the seco=
nd=20
> camp because as I think about it, separating positional and named argumen=
ts=20
> seems to make a lot of sense.=20
>
>
> This seems to be the same as what you=E2=80=99ve been saying throughout t=
his=20
> thread. Is there a problem or are you affirming the previous ideas? I=E2=
=80=99m a=20
> little confused. Also I don=E2=80=99t see how this relates to what=E2=80=
=99s in the posted=20
> draft so far.
>
>
I have not written about named arguments yet in my draft. I'm mostly=20
thinking out loud. It seems like everyone here is in the struct argument=20
passing camp. If anyone has strong opinions either way, I'd love to hear=20
it.=20

--=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/.

------=_Part_457_19075104.1403020369085
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Tuesday, June 17, 2014 11:21:51 AM UTC-4, David=
 Krauss wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-l=
eft: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div style=3D"wo=
rd-wrap:break-word"><br><div><div>On 2014=E2=80=9306=E2=80=9317, at 10:59 P=
M, Matthew Fioravante &lt;<a href=3D"javascript:" target=3D"_blank" gdf-obf=
uscated-mailto=3D"sp4QVwP-39MJ" onmousedown=3D"this.href=3D'javascript:';re=
turn true;" onclick=3D"this.href=3D'javascript:';return true;">fmatth...@gm=
ail.com</a>&gt; wrote:</div><br><blockquote type=3D"cite"><div dir=3D"ltr">=
As I'm working on the paper and thinking about the details of the proposal,=
 I've found a few issues to wrestle with.<br><br>The major difference betwe=
en aggregate initialization and a set of what I call in the paper compiler =
generated "aggregate member constructors":<br><br>Aggregates can be left in=
 an uninitialized state by not specifying an initializer. If we drop aggreg=
ate initialization in favor of constructors, we still need to support this =
behavior.<br></div></blockquote><div><br></div><div>Who is =E2=80=9Cwe=E2=
=80=9D? Surely you don=E2=80=99t mean dropping it from the standard, but yo=
u=E2=80=99re just considering the case when the user is migrating a class f=
rom from aggregate to constructor?</div><div><br></div><div>Hmm. Checking t=
he draft:</div><div><blockquote type=3D"cite"><p>First, this syntax is yet =
another <i>special case</i> inherited for C
compatibility. These compatibility cases complicate the standard
and the learning
curve for C++ developers. It would be better if this feature could
be reimplemented using already existing C++ rules and mechanisms
and still retain C compatibility.</p></blockquote></div><div>This seems to =
be veering away from the problem statement. =E2=80=9CNewer would be better=
=E2=80=9D is not much of a motivation. You need to clearly state what=E2=80=
=99s broken before going down this path. For what it=E2=80=99s worth, aggre=
gate initialization has been maintained just as carefully as the rest of th=
e language.</div></div></div></blockquote><div><br>The idea is that if aggr=
egate initialization for class types can be completely reproduced by compil=
er generated constructors, we don't actually need it. This is a side questi=
on and not too important. <br></div><blockquote class=3D"gmail_quote" style=
=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: =
1ex;"><div style=3D"word-wrap:break-word"><div><br><blockquote type=3D"cite=
"><div dir=3D"ltr">Named function parameters using structs chicken and egg =
problem:<br><br>If we had named function params, aka:<br><br>int foo(int a,=
 int b, int c);<br>foo(.a =3D 1, .b =3D 2, .c =3D 4);<br><br>Then having de=
signated initializers for structs would just fall out from this in the cons=
tructors.<br><br>If we introduce designated initializers first, then named =
function parameters are derived from that. I'm falling more and more into t=
he second camp because as I think about it, separating positional and named=
 arguments seems to make a lot of sense. <br></div></blockquote><div><br></=
div><div>This seems to be the same as what you=E2=80=99ve been saying throu=
ghout this thread. Is there a problem or are you affirming the previous ide=
as? I=E2=80=99m a little confused. Also I don=E2=80=99t see how this relate=
s to what=E2=80=99s in the posted draft so far.</div></div><br></div></bloc=
kquote><div><br>I have not written about named arguments yet in my draft. I=
'm mostly thinking out loud. It seems like everyone here is in the struct a=
rgument passing camp. If anyone has strong opinions either way, I'd love to=
 hear it. <br></div></div>

<p></p>

-- <br />
<br />
--- <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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_457_19075104.1403020369085--

.
