Fully dynamic d by opDotExp overloading

Michel Fortin michel.fortin at michelf.com
Sat Apr 18 18:24:06 PDT 2009


On 2009-04-18 17:48:33 -0400, Andrei Alexandrescu 
<SeeWebsiteForEmail at erdani.org> said:

> Michel Fortin wrote:
>> On 2009-04-18 11:19:38 -0400, Andrei Alexandrescu 
>> <SeeWebsiteForEmail at erdani.org> said:
>> 
>>> I'm confused. Isn't it clear that at the moment we "have" the ability 
>>> to pass a function name as a runtime string?
>> 
>> Indeed, you can pass the template argument as a runtime argument to 
>> another function. No misunderstanding here.
>> 
>> 
>>> What we're lacking is the ability to implement that using reflection, 
>>> but that's an entirely separated discussion!
>> 
>> Runtime reflection lacking indeed, but wether runtime reflection is an 
>> entirely separated discussion depends on if what we're doing will get 
>> in the way of implementing it.
>> 
>> 
>>> And no, you're not supposed to forward from invoke(string, 
>>> Variant[]...) to opDotExp - it's precisely the other way around!
>> 
>> Wrong. Whether it's one way or another entirely depends on what your goals are.
> 
> Wrong. It's impossible to pass a dynamic string as a static string, so 
> the street is one way.

Indeed it's impossible using a template which requires a static string. 
And that's exactly the problem: some times you're supposed to make it 
work both ways, as I've explained in the rest of my post you've cut 
down. Did you read it?

I won't repeat everything, but here's the important part: not having it 
go both ways *is* an important drawback. And it doesn't go both ways 
only if opDotExp is a template.

-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/




More information about the Digitalmars-d mailing list