Do we want functions to act as properties, or merely omit parens for ufcs/chaining?

eles eles at eles.com
Tue Jan 29 06:38:43 PST 2013


On Tuesday, 29 January 2013 at 14:33:12 UTC, Chad Joan wrote:
> On 01/29/2013 09:14 AM, eles wrote:
>> On Tuesday, 29 January 2013 at 13:51:05 UTC, Chad Joan wrote:
>>> On 01/29/2013 06:26 AM, eles wrote:
>>>> On Tuesday, 29 January 2013 at 11:13:19 UTC, jerro wrote:
>>>>> to the one used for functions. That way, you can avoid 
>>>>> verbosity and
>>>>> the need to use implicit parameters
>>> IIRC, C# goes like this:
> I do care.  Whether things are const or not matters a lot.  You 
> wouldn't be able to write (foo.prop = "hi") if prop has a 
> non-const parameter.

So, with the current approach, if one forgets to write the 
non-const parameter, will very likely end up with a property that 
is context-sensitive...

Surely, I have the feeling that functions are the simple thing, 
while properties are some new, more complicated language 
constructs, that were invented in order to overcome the 
limitations of those poor functions...

At least now we have a strong reason why properties are needed in 
the language: just as every C/C++ program can be reduced to a 
for() loop, so every D program will be reduceable to a 
property... It is a matter to keep up with C++ after all.


More information about the Digitalmars-d mailing list