typeof()

Gor Gyolchanyan gor.f.gyolchanyan at gmail.com
Thu Oct 20 07:20:06 PDT 2011


Of course. that's why it's called "run-time" type info.
This is why i want a python-like duck typing support in Phobos.
No, variant won't do, it's for a completely different purpose.
It would be a single class, which represents any Object and would have
an opDispatch, which would redirect the calls to the underlying object
or throw an exception if the call is invalid.

On Thu, Oct 20, 2011 at 6:13 PM, Steven Schveighoffer
<schveiguy at yahoo.com> wrote:
> On Thu, 20 Oct 2011 10:07:12 -0400, Gor Gyolchanyan
> <gor.f.gyolchanyan at gmail.com> wrote:
>
>>> D's runtime type info is very limited, so you may not be able to get what
>>> you are looking for.
>>
>> D's compile-time type info is very rich and it's easy to remember it
>> for run-time use.
>
> Yes, but if what you need is run time type info (like information about the
> derived class of a concrete base reference), then you cannot use
> compile-time type info.
>
> -Steve
>


More information about the Digitalmars-d mailing list