#unset & #unsetenv Directives
[posted 2004/10/26]
[Notes issued with the release of PIKT 1.18.0pre2, which introduced the new #unset & #unsetenv directives, also new #set & #setenv variants.]
PIKT 1.18.0pre2 adds the new #unset and #unsetenv preprocessor directives, which undo the effects of the #set and #setenv directives.
It is now also possible to use #set and #setenv without specifying assigned values, in which case the environment variable is implicitly set to 1. So
#set foo
is equivalent to
#set foo = "1"
and
#setenv foo "1"
If you do this in one of your configuration files
#set foo #include <files/this_files.cfg> #unset foo
you could have in this_files.cfg
#include [test $foo && /bin/cat /pikt/lib/configs/files/that_files.cfg]
or perhaps #include the output of some process
#include [/usr/local/bin/bar.pl]
where bar.pl references the $foo environment variable, for example with
if ($ENV{foo}) { ... }
Once again, at pikt.org, we use #set (and #setenv) and #unset (and #unsetenv) to pass parameters from parent configuration files to their children #include files. Eventually, using examples from our website operations at pikt.org (also earlymusichicago.org), we hope to explain all of these new advanced preprocessing directives and techniques in greater detail.
For more examples, see Developer's Notes.