Fully dynamic d by opDotExp overloading

Nick Sabalausky a at a.a
Fri Apr 17 14:45:37 PDT 2009


"Andrei Alexandrescu" <SeeWebsiteForEmail at erdani.org> wrote in message 
news:gsaqe6$25kf$1 at digitalmars.com...
> Leandro Lucarella wrote:
>>
>> This is like foreach. In C a for loop is a for loop, you are never 
>> calling
>> a bizarre member function when looping. When you see code using foreach,
>> you have to go look the variable definition to see if it's a real array 
>> to
>> see what the looping is doing.
>>
>> Do we need foreach? No, it's just syntax sugar. But I think it makes life
>> much more easier...
>>
>>
>> There is a lot of black magic already doing on that makes much harder to
>> see what's really going on with a piece of code (operator overloading?).
>> If you don't like that, you should probably stick to C =)
>>

There a point I keep bringing up that keeps getting ignored: the 
code-obscuring "black magic" that we already have provides real non-trivial 
benefits. I have yet to see an equally compelling case for the ability to 
call a dynamic method without an explicit dispatcher.

> It's more than just convenience; it's integration. Uniform form allows 
> generic algorithms to operate on a variety of types. Somehow this argument 
> keeps on being ignored in the discussion.
>

That's not ignored at all, in fact I've already addressed it twice before: A 
reflection API that supports method invokation allows for generic calling of 
both static and dynamic functions.





More information about the Digitalmars-d mailing list