220 5915 <521DAAF4.3050100@beamways.com> article
Path: news.gmane.org!not-for-mail
From: Bengt Gustafsson <bengt.gustafsson@beamways.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Properties Syntax
Date: Wed, 28 Aug 2013 09:47:00 +0200
Lines: 65
Approved: news@gmane.org
Message-ID: <521DAAF4.3050100@beamways.com>
References: <e18c3ee9-66f7-48e0-bd8b-04051c952de0@isocpp.org> <5e23a0e9-2bd9-4f62-aa83-47bea8144eae@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable
X-Trace: ger.gmane.org 1377676014 23434 80.91.229.3 (28 Aug 2013 07:46:54 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 28 Aug 2013 07:46:54 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCRIRSPDTQIRB36V62IAKGQEVOEFFHI@isocpp.org Wed Aug 28 09:46:56 2013
Return-path: <std-proposals+bncBCRIRSPDTQIRB36V62IAKGQEVOEFFHI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ee0-f70.google.com ([74.125.83.70])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCRIRSPDTQIRB36V62IAKGQEVOEFFHI@isocpp.org>)
	id 1VEaSu-0005Re-9j
	for gclcip-std-proposals@m.gmane.org; Wed, 28 Aug 2013 09:46:56 +0200
Original-Received: by mail-ee0-f70.google.com with SMTP id b15sf6122698eek.1
        for <gclcip-std-proposals@m.gmane.org>; Wed, 28 Aug 2013 00:46:55 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20120113;
        h=message-id:date:from:user-agent:mime-version:to:subject:references
         :in-reply-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
         :content-transfer-encoding;
        bh=pnrzVjk1JETSpU4OwK9IUB7+zGMhkCh67O9n9qFYTq8=;
        b=Snrlwperi+2P00YE1+expTKxQ2ddOY+mDh6iUZn5am2s9PnjPtGK2sa69kxfo8x8xY
         Mus38C1sMc7jF3VPCOgqTPD+9n2x02fxMrjzckdDsVP03ZMqgz3Ba041TXmmGkzUwtdp
         EqMaEcwwmDGi27+P+Tp4ENB632fYPYf4ygY6v4nO61eKi96m9guB/QZxDsXyBEy+EM4b
         GQfwL+R88R8/E8BciCCbnwiRZVxzYEzrMRbYwAY/D+Lg+5G93WuSB4vPgGYW86zyjQS5
         voPz3ONZB05LAf77/phfbSZbZrf+Qw53z3+OiVt2hJKE2QO/r06Epj5ZvJ59BJoJ3u9E
         I+cQ==
X-Received: by 10.112.11.20 with SMTP id m20mr5707023lbb.4.1377676015310;
        Wed, 28 Aug 2013 00:46:55 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.152.120.199 with SMTP id le7ls12958lab.77.gmail; Wed, 28 Aug
 2013 00:46:54 -0700 (PDT)
X-Received: by 10.112.42.68 with SMTP id m4mr21213815lbl.4.1377676014710;
        Wed, 28 Aug 2013 00:46:54 -0700 (PDT)
Original-Received: from vsp02.s.thehostingplatform.com (vsp02.s.thehostingplatform.com. [213.180.89.90])
        by mx.google.com with ESMTPS id i6si4947430lah.161.1969.12.31.16.00.00
        (version=TLSv1 cipher=RC4-SHA bits=128/128);
        Wed, 28 Aug 2013 00:46:54 -0700 (PDT)
Received-SPF: neutral (google.com: 213.180.89.90 is neither permitted nor denied by best guess record for domain of bengt.gustafsson@beamways.com) client-ip=213.180.89.90;
Original-Received: from [192.168.1.68] (unknown [85.229.130.195])
	by vsp02.s.thehostingplatform.com (Halon Mail Gateway) with ESMTPSA
	for <std-proposals@isocpp.org>; Wed, 28 Aug 2013 09:46:52 +0200 (CEST)
User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8
In-Reply-To: <5e23a0e9-2bd9-4f62-aa83-47bea8144eae@isocpp.org>
X-Original-Sender: bengt.gustafsson@beamways.com
X-Original-Authentication-Results: mx.google.com;       spf=neutral
 (google.com: 213.180.89.90 is neither permitted nor denied by best guess
 record for domain of bengt.gustafsson@beamways.com) smtp.mail=bengt.gustafsson@beamways.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:5915
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/5915>

How about doing the change in the other end:

Don't change anything in the class head, but allow an implicit=20
transformation:

object.property =3D value;

to

object.property(value);

IFF property is a function which has an overload that can be called with=20
a single parameter of value's type.

As function pointers and functions are different I don't see that this=20
can interfer with an assignment that is allowed today. Also this is=20
consistent with what is already allowed at construction time!

The getter case is a little harder to accept for me, but I think it=20
would be possible to allow:

int value =3D object.property;

IFF property is a method which has a 0-ary overload.

I am not positive but at least I think that using the address of a=20
method without a leading & is not allowed when you really want to get at=20
the method pointer, so this should not be ambiguous. In contrast, it=20
would not be possible to omit the trailing () for a global function as=20
(due to feature inheritance from C) this means the address of the=20
function (correct me if I'm wrong on this).


Personally I am so entrenched with C++ that I don't really understand=20
how property syntax would improve the world, but if it is to enter the=20
language it seems that it can be done without adding keywords or=20
additional messy declarations in the headers. I do think that my=20
suggested approach could have some inherent dangers that I don't see=20
right now, especially the getter part of it.

Even if properties implemented like this could be parsed unambiguously=20
there is also the risk of too little redundancy: If every possible=20
combination of letters has a valid meaning there will be no error=20
messages to warn you when you are doing the wrong things with unexpected=20
results.

--=20
Bengt Gustafsson
CEO, Beamways AB
Westmansgatan 37A
582 16 Link=F6ping, Sweden
+46 13 465 10 85
www.beamways.com

--=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/.

.
