Conditional Compilation¶
Conditional compilation builds on the same principle as term_expansion//22, goal_expansion//22 and the expansion of grammar rules to compile sections of the source-code conditionally.
One of the reasons for introducing conditional compilation is to simplify writing portable code.
Note that these directives can only be appear as separate terms in the input. Typical usage scenarios include:
`Load different libraries on different dialects
Define a predicate if it is missing as a system predicate
Realise totally different implementations for a particular
part of the code due to different capabilities.
Realise different configuration options for your software.
````
:- if (test1). section_1. :- elif(test2). section_2. :- elif(test3). section_3. :- else. section_else. :- endif. ```