Compiler patch for runtime reflection

Gor Gyolchanyan gor.f.gyolchanyan at gmail.com
Tue Oct 25 09:42:04 PDT 2011


> Thank you, I'm glad you agree.

Of course. Reflection should _never_ expose private stuff.

> Would dynamic interfaces be similar to isRange!T? i.e. a function which tests a dynamic-object for certain fields/functions.

Hmmm..... Yeap. Exactly. Anything else i would say would be a
derivative of it. I can't do it currently. Also, as discussed before,
i should never see private stuff this way (any any other way).

> Would dynamic overload be a subset of prototype-style objects?

Huh? Dynamic overloading is basically multi-methods. It chooses the
implementation based on run-time type of the parameters.
This could be further improved by allowing overloading, based on
arbitrary predicates (much like template constraints).

> Would dynamic modules simply container for dynamic functions/objects?

Basically, yes. Dynamic module would contain typemically typed
variables, functions, and types.

>  Something more?

Cant thing of anything else ATM. Will tell you if i do.

On Tue, Oct 25, 2011 at 8:29 PM, Robert Jacques <sandford at jhu.edu> wrote:
> On Tue, 25 Oct 2011 12:14:58 -0400, Gor Gyolchanyan
> <gor.f.gyolchanyan at gmail.com> wrote:
>>
>> I didn't mean reflection for violating access specifications. In that
>> case, of course, it's error-prone.
>
> Thank you, I'm glad you agree.
>
>> What i meant was a set of dynamic counterparts of static features of D:
>> * Dynamic interfaces
>> * Dynamic overloading
>> * Dynamic modules
>> * ...
>> That's what i had in mind.
>
> Care to explain what would each of those should look like?
>
> Would dynamic interfaces be similar to isRange!T? i.e. a function which
> tests a dynamic-object for certain fields/functions.
>
> Would dynamic overload be a subset of prototype-style objects?
>
> Would dynamic modules simply container for dynamic functions/objects?
> Something more?
>


More information about the Digitalmars-d mailing list