Any equivalent to python's dir(object) in D?

bearophile via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon May 5 01:16:52 PDT 2014


Chris Piker:

> Is there any way to get a list of the properties and functions 
> provided by a module or class or generic variable in D at 
> runtime?

In D there are various traits to do that a compile-time. Like:
http://dlang.org/traits.html#allMembers

There are also the Phobos traits:
http://dlang.org/phobos/std_traits.html

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list