220 5966 <CAFk2RUZtcXKP75N-1WEuhWtJkUAFCBcuN8HaV2Ak-PtmLZ6fNA@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Ville Voutilainen <ville.voutilainen@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Properties Syntax
Date: Thu, 29 Aug 2013 08:25:50 +0300
Lines: 153
Approved: news@gmane.org
Message-ID: <CAFk2RUZtcXKP75N-1WEuhWtJkUAFCBcuN8HaV2Ak-PtmLZ6fNA@mail.gmail.com>
References: <e18c3ee9-66f7-48e0-bd8b-04051c952de0@isocpp.org>
	<5e23a0e9-2bd9-4f62-aa83-47bea8144eae@isocpp.org>
	<CALQmNFjE1QX9CMt_7bo3XRLKv4rXsbiYAo9dqkUK5TCqLyyGEw@mail.gmail.com>
	<CAFk2RUagizA4UKrnb__8oJXB2ni96ZwYTzAp=HTgOdMZCDXwOA@mail.gmail.com>
	<5458c2e0-2e03-444e-a34d-4960a07b94ad@isocpp.org>
	<CAFk2RUZnSCL2fUx53uqZZTKEb2ZPypSu6KRw0jr4uRxczfjVYw@mail.gmail.com>
	<ab7fed92-f922-459a-856f-4eea42b113e9@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=001a11c2cbf2cd39a804e50f5613
X-Trace: ger.gmane.org 1377753952 637 80.91.229.3 (29 Aug 2013 05:25:52 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Thu, 29 Aug 2013 05:25:52 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC5JHI7A7ALRBXVW7OIAKGQE5KVDFPA@isocpp.org Thu Aug 29 07:25:53 2013
Return-path: <std-proposals+bncBC5JHI7A7ALRBXVW7OIAKGQE5KVDFPA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qa0-f70.google.com ([209.85.216.70])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBC5JHI7A7ALRBXVW7OIAKGQE5KVDFPA@isocpp.org>)
	id 1VEujw-0003UR-5I
	for gclcip-std-proposals@m.gmane.org; Thu, 29 Aug 2013 07:25:52 +0200
Original-Received: by mail-qa0-f70.google.com with SMTP id ii20sf425449qab.9
        for <gclcip-std-proposals@m.gmane.org>; Wed, 28 Aug 2013 22:25:51 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=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=JTBaSJn3ZcR2ZXhTBq58LuA2xQUQzk/mGa+yjNwsImg=;
        b=fy4i0CpfXdOWeDKiEpEC4tplvEyldg7/70IZorH0uEwsNwOC+9LebQ7hoGV3HikI5E
         1qVX9BSS9+BYOeUpr8wmd8gOM0OGCGWP900mYxqM+d60CqneCdgCvBpBr5R3xj6SgvHU
         2pAliK4IFmkNAxkiyYnPsnIJjJwQfC7UjCcol5Ahx2URnIgfxDIrpTkpi40403Q/S6WH
         GvjxEurcNbocBm2CUhMQw8pveT5VB3t3LDYwm9hRyP3ieKHR+RORbGYqhLy16Hsc4IxI
         FyoNPyeZYi9FpcLwFFuSLoFCUjjv5VVg9tSrPwttKZf1Ax9b40xwQ9tljw9mtSAzVVcb
         T9+A==
X-Received: by 10.224.223.198 with SMTP id il6mr2502866qab.7.1377753951128;
        Wed, 28 Aug 2013 22:25:51 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.96.9 with SMTP id do9ls653136qeb.80.gmail; Wed, 28 Aug 2013
 22:25:50 -0700 (PDT)
X-Received: by 10.49.130.132 with SMTP id oe4mr325229qeb.86.1377753950616;
        Wed, 28 Aug 2013 22:25:50 -0700 (PDT)
Original-Received: from mail-qc0-x236.google.com (mail-qc0-x236.google.com [2607:f8b0:400d:c01::236])
        by mx.google.com with ESMTPS id b3si843048qeg.79.1969.12.31.16.00.00
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Wed, 28 Aug 2013 22:25:50 -0700 (PDT)
Received-SPF: pass (google.com: domain of ville.voutilainen@gmail.com designates 2607:f8b0:400d:c01::236 as permitted sender) client-ip=2607:f8b0:400d:c01::236;
Original-Received: by mail-qc0-f182.google.com with SMTP id k18so1553695qcv.41
        for <std-proposals@isocpp.org>; Wed, 28 Aug 2013 22:25:50 -0700 (PDT)
X-Received: by 10.224.6.9 with SMTP id 9mr2592352qax.41.1377753950401; Wed, 28
 Aug 2013 22:25:50 -0700 (PDT)
Original-Received: by 10.224.195.8 with HTTP; Wed, 28 Aug 2013 22:25:50 -0700 (PDT)
In-Reply-To: <ab7fed92-f922-459a-856f-4eea42b113e9@isocpp.org>
X-Original-Sender: ville.voutilainen@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of ville.voutilainen@gmail.com designates 2607:f8b0:400d:c01::236 as
 permitted sender) smtp.mail=ville.voutilainen@gmail.com;       dkim=pass
 header.i=@gmail.com;       dmarc=pass (p=NONE dis=NONE) d=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:5966
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/5966>

--001a11c2cbf2cd39a804e50f5613
Content-Type: text/plain; charset=ISO-8859-1

On 29 August 2013 04:42, Nick <nicolas.jinchereau@gmail.com> wrote:

> On Wednesday, 28 August 2013 20:59:49 UTC-4, Ville Voutilainen wrote:
>
>
>>
>>
>> On 29 August 2013 02:04, Nicol Bolas <jmck...@gmail.com> wrote:
>>
>>>
>>> If properties are syntactically a good and wanted thing, then they
>>> deserve the dignity of being a proper language feature. And if
>>>
>>>
>> Do people think properties should be a language feature, when they are
>> seemingly just one of the many
>> things compile-time reflection can provide?
>>
>
> I keep hearing people try to relate reflection to properties. This doesn't
> make any sense to me at all. Can you provide a pseudo code example of how a
> property would be retrieved using a reflection interface?
>
>
>
>
Depends on how far people are willing to go with reflection. ;) One of the
expectations of people proposing
reflection facilities is that
1) you can query the member functions and member data of a type
2) you can customize how a type answers to such queries

The part 2 may effectively involve being able to more or less overload
operator. or its equivalent
so that when queried for a member f() or x, the type can return whatever it
pleases, a reference to an existing member
of the type itself, a reference to a subobject or a member thereof, or
something more dynamic.

Completely imaginary, with quite a bunch of potentially controversial
facilities:
struct X
{
private:
    int y;
public:
    template<compile_time_string s> decltype(auto) operator-><s>()
    {
        static if (s == "x") {
            return y;
        } else {
            static_assert(false, "no such member");
        }
    }
};

The use is then

X x;
int foo = x.x;

or more verbosely,
X x;
int foo = std::reflection::member<compiletimestring("x")>(x);

-- 

--- 
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/.

--001a11c2cbf2cd39a804e50f5613
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><br><div class=3D"gmail=
_quote">On 29 August 2013 04:42, Nick <span dir=3D"ltr">&lt;<a href=3D"mail=
to:nicolas.jinchereau@gmail.com" target=3D"_blank">nicolas.jinchereau@gmail=
..com</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr"><span style=3D"font-size:13=
px">On Wednesday, 28 August 2013 20:59:49 UTC-4, Ville Voutilainen  wrote:<=
/span><div class=3D"im">
<br><blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;b=
order-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><br><div><br><=
br><div class=3D"gmail_quote">On 29 August 2013 02:04, Nicol Bolas <span di=
r=3D"ltr">&lt;<a>jmck...@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr"><br><div>If properties are =
syntactically a good and wanted thing, then they deserve the dignity of bei=
ng a proper language feature. And if<br>

<br></div></div></blockquote><div><br></div><div>Do people think properties=
 should be a language feature, when they are seemingly just one of the many=
<br>things compile-time reflection can provide?</div></div></div></div>
</blockquote><div><br></div></div><div>I keep hearing people try to relate =
reflection to properties. This doesn&#39;t make any sense to me at all. Can=
 you provide a pseudo code example of how a property would be retrieved usi=
ng a reflection interface?</div>
</div><div class=3D"HOEnZb"><div class=3D"h5">

<p></p>

<br><br></div></div></blockquote><div><br></div><div>Depends on how far peo=
ple are willing to go with reflection. ;) One of the expectations of people=
 proposing<br>reflection facilities is that<br></div><div>1) you can query =
the member functions and member data of a type<br>
</div><div>2) you can customize how a type answers to such queries<br><br><=
/div><div>The part 2 may effectively involve being able to more or less ove=
rload operator. or its equivalent<br>so that when queried for a member f() =
or x, the type can return whatever it pleases, a reference to an existing m=
ember<br>
</div><div>of the type itself, a reference to a subobject or a member there=
of, or something more dynamic.<br><br></div><div>Completely imaginary, with=
 quite a bunch of potentially controversial facilities:<br></div><div>struc=
t X<br>
{<br></div><div>private:<br></div><div>=A0=A0=A0 int y;<br></div><div>publi=
c:<br></div><div>=A0=A0=A0 template&lt;compile_time_string s&gt; decltype(a=
uto) operator-&gt;&lt;s&gt;()<br>=A0=A0=A0 {<br></div><div>=A0=A0=A0=A0=A0=
=A0=A0 static if (s =3D=3D &quot;x&quot;) {<br>
</div><div>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return y;<br></div><div>=A0=A0=
=A0=A0=A0=A0=A0 } else {<br></div><div>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 st=
atic_assert(false, &quot;no such member&quot;);<br></div><div>=A0=A0=A0=A0=
=A0=A0=A0 }<br></div><div>=A0=A0=A0 }<br></div><div>}; <br></div></div><br>
</div><div class=3D"gmail_extra">The use is then<br><br></div><div class=3D=
"gmail_extra">X x;<br>int foo =3D x.x;<br><br></div><div class=3D"gmail_ext=
ra">or more verbosely, <br></div><div class=3D"gmail_extra">X x;<br></div><=
div class=3D"gmail_extra">
int foo =3D std::reflection::member&lt;compiletimestring(&quot;x&quot;)&gt;=
(x);<br></div></div>

<p></p>

-- <br />
&nbsp;<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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<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 />

--001a11c2cbf2cd39a804e50f5613--

.
