220 12085 <CAB+4KHL=pYu49-veRkJz0sHm-kjxOqTvLHoR3ng3Cp6NRUkWWQ@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Andrew Tomazos <andrewtomazos@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Object scope access
Date: Sat, 26 Jul 2014 12:40:27 +0200
Lines: 169
Approved: news@gmane.org
Message-ID: <CAB+4KHL=pYu49-veRkJz0sHm-kjxOqTvLHoR3ng3Cp6NRUkWWQ@mail.gmail.com>
References: <628bd33d-db38-438f-8eea-26831c3ad268@isocpp.org>
	<97b98f0c-4d59-4aba-bb30-d16601caa5a7@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=90e6ba1efb747252da04ff16518d
X-Trace: ger.gmane.org 1406371237 7623 80.91.229.3 (26 Jul 2014 10:40:37 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sat, 26 Jul 2014 10:40:37 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBD5KHQXXWYPRBHELZ2PAKGQE5KLS7TY@isocpp.org Sat Jul 26 12:40:30 2014
Return-path: <std-proposals+bncBD5KHQXXWYPRBHELZ2PAKGQE5KLS7TY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-oa0-f70.google.com ([209.85.219.70])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBD5KHQXXWYPRBHELZ2PAKGQE5KLS7TY@isocpp.org>)
	id 1XAzOw-0008Nh-02
	for gclcip-std-proposals@m.gmane.org; Sat, 26 Jul 2014 12:40:30 +0200
Original-Received: by mail-oa0-f70.google.com with SMTP id eb12sf33797363oac.5
        for <gclcip-std-proposals@m.gmane.org>; Sat, 26 Jul 2014 03:40:28 -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:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe:content-type;
        bh=LfbljT0OCodC2lblpodFPFnLK50QwDoMGmQVCXa/r/o=;
        b=Zx3q6GkCrz0acCqY6tvAw4lhWD0FXI+f7128mKTNRWvvhYFWQn7/8cRTsvizAQh/jm
         UlUKsN1gbgdBxomLSseRlEECUUTUKcikxKPhua7+oOXAB7682t+xb9LDF52gU1VzfqxM
         gawAR3ZCZeU9zFpxf/rdOVRde9gbawWlcwSra0Z+lon4iWtXcJaXrrSj8bh1RER9YBdF
         w3ad5+fM1D68j3KL1B5T1twJ19uucsbibVfdTSAu00/AqypEAFswnzFN+aO+d7NoZ+Rc
         ylyY78P6mkPtTVYLkQsUKnwDTnE+NpJoV5ntUKV7vpfcTsctr8dm4Oa4g9EQr28MZfKb
         Hsfw==
X-Gm-Message-State: ALoCoQkoP5rjitY2ksIz0fbDu9RTft3aYsV0VzDhTmamLujdQdw0kI0B68kohZV1kZbVMIhhuym0
X-Received: by 10.42.119.82 with SMTP id a18mr13193893icr.19.1406371228859;
        Sat, 26 Jul 2014 03:40:28 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.51.17.72 with SMTP id gc8ls907803igd.35.gmail; Sat, 26 Jul
 2014 03:40:27 -0700 (PDT)
X-Received: by 10.43.95.10 with SMTP id ca10mr27639719icc.55.1406371227840;
        Sat, 26 Jul 2014 03:40:27 -0700 (PDT)
Original-Received: from mail-ie0-x22c.google.com (mail-ie0-x22c.google.com [2607:f8b0:4001:c03::22c])
        by mx.google.com with ESMTPS id i4si2703644igj.19.2014.07.26.03.40.27
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Sat, 26 Jul 2014 03:40:27 -0700 (PDT)
Received-SPF: pass (google.com: domain of andrewtomazos@gmail.com designates 2607:f8b0:4001:c03::22c as permitted sender) client-ip=2607:f8b0:4001:c03::22c;
Original-Received: by mail-ie0-f172.google.com with SMTP id lx4so4770103iec.17
        for <std-proposals@isocpp.org>; Sat, 26 Jul 2014 03:40:27 -0700 (PDT)
X-Received: by 10.42.39.142 with SMTP id h14mr28653377ice.32.1406371227648;
 Sat, 26 Jul 2014 03:40:27 -0700 (PDT)
Original-Received: by 10.64.76.231 with HTTP; Sat, 26 Jul 2014 03:40:27 -0700 (PDT)
Original-Received: by 10.64.76.231 with HTTP; Sat, 26 Jul 2014 03:40:27 -0700 (PDT)
In-Reply-To: <97b98f0c-4d59-4aba-bb30-d16601caa5a7@isocpp.org>
X-Original-Sender: andrewtomazos@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of andrewtomazos@gmail.com designates 2607:f8b0:4001:c03::22c as
 permitted sender) smtp.mail=andrewtomazos@gmail.com;       dkim=pass
 header.i=@gmail.com;       dmarc=pass (p=NONE dis=NONE) header.from=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: <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:12085
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/12085>

--90e6ba1efb747252da04ff16518d
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

I just asked the commitee the other day if something like the Pascal
with-statement had been proposed for C++ and if not, if there was any
interest.  Dr Stroustrup said that it had been proposed before and there
wasn't any interest.  Sorry.
On Jul 25, 2014 12:01 AM, <morwenn29@gmail.com> wrote:

> The Game Maker Language (yes, the language used by Game Maker) has
> something akin to what you propose:
>
> with (person)
> {
>     if (name =3D=3D "gord")
>     {
>         age =3D 99;
>     }
> }
>
> Le jeudi 24 juillet 2014 23:43:22 UTC+2, Ezekiel Warren a =C3=A9crit :
>>
>> I propose having the ability to create a scope with access to an objects
>> members.
>>
>> *This example explains itself:*
>> struct Person {
>> string name;
>> int age;
>> };
>>
>> Person person;
>>
>> // Creating a new scope with access to an objects members
>> person.{
>> if(name =3D=3D "gord") {
>> age =3D 99;
>> }
>> }
>>
>> // Function with access to an objects members
>> void Func() person.{
>> age +=3D 2;
>> }
>>
>> // Lambda with access to an objects members
>> auto Lambda =3D [] person.{
>> age -=3D 2;
>> };
>>
>> It would also work with if, else, for, while, do, and switch. By default
>> class member functions have access to this.
>>
>> What do you think?
>>
>  --
>
> ---
> 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.
> Visit this group at
> http://groups.google.com/a/isocpp.org/group/std-proposals/.
>

--=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/.

--90e6ba1efb747252da04ff16518d
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<p dir=3D"ltr">I just asked the commitee the other day if something like th=
e Pascal with-statement had been proposed for C++ and if not, if there was =
any interest.=C2=A0 Dr Stroustrup said that it had been proposed before and=
 there wasn&#39;t any interest.=C2=A0 Sorry.</p>

<div class=3D"gmail_quote">On Jul 25, 2014 12:01 AM,  &lt;<a href=3D"mailto=
:morwenn29@gmail.com">morwenn29@gmail.com</a>&gt; wrote:<br type=3D"attribu=
tion"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-l=
eft:1px #ccc solid;padding-left:1ex">
<div dir=3D"ltr">The Game Maker Language (yes, the language used by Game Ma=
ker) has something akin to what you propose:<br><br><div style=3D"margin-le=
ft:40px"><font face=3D"courier new,monospace">with (person)<br>{<br>=C2=A0=
=C2=A0=C2=A0 if (name =3D=3D &quot;gord&quot;)<br>
=C2=A0=C2=A0=C2=A0 {<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 age =3D =
99;<br>=C2=A0=C2=A0=C2=A0 }<br>}<br></font></div><br>Le jeudi 24 juillet 20=
14 23:43:22 UTC+2, Ezekiel Warren a =C3=A9crit=C2=A0:<blockquote class=3D"g=
mail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;=
padding-left:1ex">
<div dir=3D"ltr">I propose having the ability to create a scope with access=
 to an objects members.<div><br></div><div><b>This example explains itself:=
</b><div><div style=3D"border:1px solid rgb(187,187,187);word-wrap:break-wo=
rd;background-color:rgb(250,250,250)">
<code><div><div><font color=3D"#660066">struct Person {</font></div><div><f=
ont color=3D"#660066"><span style=3D"white-space:pre-wrap">	</span>string n=
ame;</font></div><div><font color=3D"#660066"><span style=3D"white-space:pr=
e-wrap">	</span>int age;</font></div>
<div><font color=3D"#660066">};</font></div><div><font color=3D"#660066"><b=
r></font></div><div><font color=3D"#660066">Person person;</font></div><div=
><font color=3D"#660066"><br>// Creating a new scope with access to an obje=
cts members</font></div>
<div><font color=3D"#660066">person.{</font></div><div><font color=3D"#6600=
66"><span style=3D"white-space:pre-wrap">	</span>if(name =3D=3D &quot;gord&=
quot;) {</font></div><div><font color=3D"#660066"><span style=3D"white-spac=
e:pre-wrap">		</span>age =3D 99;</font></div>
<div><font color=3D"#660066"><span style=3D"white-space:pre-wrap">	</span>}=
</font></div><div><font color=3D"#660066">}<br><br>// Function with access =
to an objects members<br>void Func() person.{<br></font><span style=3D"colo=
r:rgb(102,0,102);white-space:pre-wrap">	</span>age +=3D 2;<font color=3D"#6=
60066"><br>
}<br><br>// Lambda with access to an objects members<br>auto Lambda =3D [] =
person.{<br></font><span style=3D"color:rgb(102,0,102);white-space:pre-wrap=
">	</span>age -=3D 2;<font color=3D"#660066"><br>};</font></div></div></cod=
e></div>
<br>It would also work with <font face=3D"courier new, monospace">if</font>=
, <font face=3D"courier new, monospace">else</font>, <font face=3D"courier =
new, monospace">for</font>, <font face=3D"courier new, monospace">while</fo=
nt>, <font face=3D"courier new, monospace">do</font>, and <font face=3D"cou=
rier new, monospace">switch</font>. By default class member functions have =
access to <font face=3D"courier new, monospace">this</font>.</div>
</div><div><br></div><div>What do you think?</div></div></blockquote></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" target=3D"_=
blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</blockquote></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 />

--90e6ba1efb747252da04ff16518d--

.
