Fully dynamic d by opDotExp overloading

Nick Sabalausky a at a.a
Fri Apr 17 14:19:49 PDT 2009


"Andrei Alexandrescu" <SeeWebsiteForEmail at erdani.org> wrote in message 
news:gsapu0$24ei$2 at digitalmars.com...
>
> Then why overloadable operators? Just write a function call and call it a 
> day.

Overloadable operators and opDotExp both sacrifice code transparency. In 
that regard, they're the same. But
overloadable operators provide non-trivial benefit. From what I've seen, 
opDotExp doesn't.

The only real argument for opDotExp I've seen so far is for things like 
DB/DDL/haxe.xml.Fast. I've make counter-arguments to that, but I have yet to 
see those counter-arguments actually refuted. Instead I keep getting a bunch 
of "use a dynamic lang and you'll see" hand-waving. And, for the record, I 
have spent a good deal of time using dynamic langs.

> 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.)
>

Another apples-and-oranges. In C-style languages, getting rid of "call" does 
not sacrifice code transparency (unlike op overloading and opDotExp) since 
function calls can be easily identified at a glance by an identifier 
followed by parens (and calls/declarations can be easily identified by 
whether or not they're preceded by a type). As a side note, this is one of 
the reasons I hate D's parens-are-optional-when-there's-no-arguments 
feature.

> 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.
>

Please do not accuse me of such a thing simply because I haven't changed my 
opinion. You've held your ground as well, so I could just as easily accuse 
you of being closed-minded and merely reaffirming a your preconceived 
opinion. I have indeed listened to the arguments and responded to them.





More information about the Digitalmars-d mailing list