Fully dynamic d by opDotExp overloading

BCS none at anon.com
Sat Apr 18 19:37:21 PDT 2009


Hello Adam,

> On Sat, Apr 18, 2009 at 06:10:27PM -0700, Andrei Alexandrescu wrote:
> 
>> The point of using "." is not syntactic convenience as much as the
>> ability of the Dynamic structure to work out of the box with
>> algorithms that use the standard notation.
>> 
> What if the dot remained exactly like it is now and the -> took
> the place of the dot in the proposal; regular method calls when
> possible and forwarded to opExtension (opDotExp needs a better name)
> when that fails?
> Thus your generic algorithm can use -> and work in all cases, and the
> dot operator remains the same as it is now.

Going the other way would be better; '.' works as Andrei wants and '->' is 
an explicit, "don't use the dynamic stuff" invocation. If it went the other 
way virtually all template code would end up needing to use '->' for everything 
just in cases someone wants to pass in a type that uses opDotExp.





More information about the Digitalmars-d mailing list