Fully dynamic d by opDotExp overloading

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Apr 17 13:48:03 PDT 2009


Nick Sabalausky wrote:
> "Adam D. Ruppe" <destructionator at gmail.com> wrote in message 
> news:mailman.1171.1239998473.22690.digitalmars-d at puremagic.com...
>> On Fri, Apr 17, 2009 at 03:54:47PM -0400, Nick Sabalausky wrote:
>>> What
>>> opDotExp is, is a tool of only occasional use that provides only a small
>>> benefit, *and* ends up destroying a much more important tool: 
>>> compile-time
>>> checking on a class's members.
>> Wouldn't the compile time checking remain the same on any class except
>> the Variant (or whatever) which implements the new operator?
>>
>> If it is constrained to one type, the destruction seems like it would be
>> acceptable. You can't trust much on a Variant at compile time anyway.
>>
> 
> The problem is there would be no way to tell at a glance whether a given 
> class uses opDotExp or not. You'd have to go look it up for every class. So, 
> ok, we could solve that by requiring a different syntax for dynamic 
> invokation. But we already have that: just pass a string to a dispatch 
> function. 
> 
> 

Then why overloadable operators? Just write a function call and call it 
a day. Also, while we're at it, let's prefix all function calls with the 
word "call" so it's clear that a call is going on. (Some language did 
that after all.)

The fact of the matter is you're in this discussion only to reaffirm a 
preconceived opinion. Instead of reiterating your arguments, it might be 
of great use to listen to those made by others.


Andrei



More information about the Digitalmars-d mailing list