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
- Re: D seems interesting, but... H. S. Teoh
- Re: D seems interesting, but... Jonathan M Davis
- Re: D seems interesting, but... Gerry Weaver
- Re: D seems interesting, but... deadalnix
- Re: D seems interesting, but... Alex Rønne Petersen
- Re: D seems interesting, but... Regan Heath
- Re: D seems interesting, but... bearophile
- Re: D seems interesting, but... Regan Heath
- Re: D seems interesting, but... Walter Bright
- Re: D seems interesting, but... Jacob Carlborg
- Re: D seems interesting, but... bearophile
- Re: D seems interesting, but... Paulo Pinto
- Re: D seems interesting, but... Andrei Alexandrescu
- Re: D seems interesting, but... foobar
- Re: D seems interesting, but... Andrei Alexandrescu
- Re: D seems interesting, but... foobar
- Re: D seems interesting, but... bearophile
- Re: D seems interesting, but... Andrei Alexandrescu
- Re: D seems interesting, but... bearophile
- Re: D seems interesting, but... 1100110
- Re: D seems interesting, but... Adam D. Ruppe