Unified function call syntax

Frank Benoit keinfarbton at googlemail.com
Sun Sep 7 06:39:00 PDT 2008


Sergey Gromov schrieb:
> Manfred_Nowak <svv1999 at hotmail.com> wrote:
>> Frank Benoit wrote:
>>> Is this a bug or feature?
>> It should be a feature.
>> One should be able to introduce the global `equal' by an alias within 
>> the body of the class:
>>
>>     alias .equal equal;
> 
> I think it should be a bug.  When defining
> 
> 	bool equals(char[] a, char[] b) {...}
> 
> you essentially define (semantically)
> 
> 	class char[] {
> 		bool equals(char[] b) {...}
> 	}
> 
> Therefore calling A.equals() instead of char[].equals() is not correct.  
> Generally speaking, for any given expression, expr.method(), the unified 
> function call mechanism should only consider methods accessible from 
> typeof(expr) context, not from current scope.
> 

http://d.puremagic.com/issues/show_bug.cgi?id=2343



More information about the Digitalmars-d mailing list