D seems interesting, but...
bearophile
bearophileHUGS at lycos.com
Mon Oct 15 04:20:25 PDT 2012
Jacob Carlborg:
> How should DMD detect if you're building a (dynamic) library?
> Sure it can see that you're not using -lib or -shared but what
> about separate complication?
What about the need to use a compiler switch if you are
performing a separate compilation?
A related enhancement request that I'm asking for since years is:
the compiler could define a compile-time constant (like
is_main_module or something) as true if the module contains the
main, and false otherwise. This allows to have a main() in each
module. This is handy to have, it allows to compile&run modules
both as normal modules to import, or to compile and run them as
stand alone programs, like when you want a module to show a demo
of its capabilities, or just run its unittests.
Bye,
bearophile
More information about the Digitalmars-d
mailing list