DUSE_MYLIB12

Vladimir Panteleev via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Feb 11 03:40:40 PST 2015


On Wednesday, 11 February 2015 at 11:26:20 UTC, Dennis Ritchie 
wrote:
> Tell me, please, is it possible to set an arbitrary condition 
> conditional compilation at the command prompt, type 
> DUSE_MYLIB12 and in the code as:
>
> version(USE_MYLIB12) {
>        .....
> }

Specify -version=USE_MYLIB12 on the command line.

> And I didn't like Any DeclarationBlock or Statement that is not 
> compiled in still must be syntactically correct:
> http://dlang.org/version.html
>
> It may be that using an optional library code is correct, and 
> without it not?

No, that's not possible. Syntactically correct != semantically 
correct. It just means that the syntax rules of the language are 
respected, e.g. parens must be correctly nested (no [} or 
something like that). Since D libraries can't affect the syntax 
of the language, no code can be syntactically correct only in 
that library's presence.


More information about the Digitalmars-d-learn mailing list