digitalmars.D.learn - DUSE_MYLIB12
- Dennis Ritchie (11/11) Feb 11 2015 Tell me, please, is it possible to set an arbitrary condition
- Vladimir Panteleev (9/20) Feb 11 2015 Specify -version=USE_MYLIB12 on the command line.
- Dennis Ritchie (1/1) Feb 11 2015 Thanks.
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) { ..... } 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?
Feb 11 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.
Feb 11 2015