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

Chris Piker via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun May 4 23:35:41 PDT 2014


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?  I've grown quite accustomed to doing the following 
kinds of exploration in Python.

With in the python interperter I can issue:

> a = some_barely_understood_function()
> dir(a)

  ...or for some new module

> import some_new_module
> dir(some_new_module)

The built in function 'dir' is handy as it prints a list of the 
members of anything.  Since there are many odd members in D such 
as "int.min" and "double.max_exp", how can I a list of all 
members of "int", or "double"?  Right now it feels like I just 
have to get luckly while searching online for this information.

Thanks


More information about the Digitalmars-d-learn mailing list