support UFCS with fully qualified function names (was in "digitalmars.D.learn")

Jonathan M Davis jmdavisProg at gmx.com
Tue May 21 01:37:31 PDT 2013


On Tuesday, May 21, 2013 01:31:36 Timothee Cour wrote:
> > you can use a property function as a normal function if you have to.
> 
> I must've missed that. Do you mean this will become valid?
> struct A{
>   int x_;
>   @property int x(){return x_;}
> }
> void main(){
> A a;
> int x1=a.x();
> int x2=a.x;
> }
> 
> > I don't think that it's really much of a loss to not be able to use UFCS
> 
> in situations like that
> 
> I keep running into such situations, because phobos reuses function names a
> lot in different modules, and it's only going to get worse as phobos size
> increases.

It's not 100% clear what's going to happen with @property, but given the last 
major discussion on it, it's quite clear that we're not going to be strictly 
enforcing @property, and the -property flag is going to get the boot (I thought 
that it was removed from the Phobos build, but it looks like it's still 
there). It seems likely that @property will have no effect on getters, and it 
may or may not be required on setters. That matter wasn't settled, but it's 
very clear that strict property enforcement was not wanted by the majority 
(too many people want optional parens), so the situation where a symbol 
conflict with a UFCS property makes it impossible to call will be going away 
(and it currently only exists when -property is used).

- Jonathan M Davis


More information about the Digitalmars-d mailing list