Fully dynamic d by opDotExp overloading
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Sat Apr 18 19:21:50 PDT 2009
Michel Fortin wrote:
> 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.
I did, but sorry, it doesn't make sense and does nothing but continue
the terrible confusion going in this thread.
You say: well if opDot were a template then a scripting language can't
get to it because what it has is a dynamic string. Yes. That's why opDot
does whatever static string processing and then forwards, if the design
asks for it, to the dynamic function. opDot's participation is solely a
syntax helper within D.
Andrei
More information about the Digitalmars-d
mailing list