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

Martin Nowak via Dlang-internal dlang-internal at puremagic.com
Mon Dec 26 17:40:50 PST 2016


On 12/26/2016 07:45 PM, Andrei Alexandrescu wrote:
> 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)?

https://github.com/dlang/druntime/pull/617

Waiting to rectify the horrible Windows DLL implementation might not
have been the best choice for that.
Also Windows DLL is even stuck on fixing export, haven't heard from
Benjamin Thaut since DConf.

-Martin


More information about the Dlang-internal mailing list