ifnot
Purpose
The ifnot() function performs a logical test on the condition and calls the first argument if the condition evaluates to true and the second argument if the condition evaluates to false.
Arguments
Requires 2 arguments. The arguments' order is important:
-
The first argument condition is the condition to be evaluated.
-
The second argument false_value is the value to return if the condition in the first argument evaluates to false.
Arguments do not have to be values. They may be pdl-functions.
Examples
The following rule checks whether the argument $m has synonyms (for the rule to work properly it is necessary to have a synonym dictionary switched on).
If the argument has a synonym or synonyms, those synonyms will be listed in the attribute.
If the argument has no synonyms, the value "no synonyms" will appear.