[Dlang-internal] How do I find and call a function in a module I only know during runtime?

Andrei Alexandrescu via Dlang-internal dlang-internal at puremagic.com
Mon Dec 26 10:45:13 PST 2016


Say I have a module "a" that wants to call a function "void fun()" in 
another module "b". The name "b" is not known until runtime, i.e. it's 
read from the console. (Really the name is obtained by iterating foreach 
(m; ModuleInfo)).

How do I get fun()'s address (or the null pointer if it doesn't exist)?


Thanks,

Andrei


More information about the Dlang-internal mailing list