Yet a new properties proposal

Dimitar Kolev DimitarRosenovKolev at hotmail.com
Wed Jul 29 14:46:39 PDT 2009


Steven Schveighoffer Wrote:

> On Wed, 29 Jul 2009 14:59:38 -0400, Dimitar Kolev  
> <DimitarRosenovKolev at hotmail.com> wrote:
> 
> > Steven Schveighoffer Wrote:
> >
> >> I don't see what advantages this has over other proposals.  What is  
> >> wrong
> >> with a.a such that we have to resort to a#a?
> >>
> >> -Steve
> >>
> >
> > People are crying over compilers not know which is a property and which  
> > is not.
> 
> At definition time, not usage time.  I want the usage to be identical to  
> fields, otherwise, it's not as seamless.  This makes an important  
> difference for generic code.

What if the compiler just expanding this to well inlining. So a#a = 3 would just means a.a = 3 just that the compiler will have easier time understanding this.

And a#b#c would just expand to a.b.c it is just that you can without any doubt see in the code that a#b#c is actually a property not a function.

The expansion can come before the generic code.

Not to mention that then there will be no confusion what writefl = 3 is. A function called without the parentheses and you won't have to track what that is in the definition of the class.




More information about the Digitalmars-d mailing list