multiway, logical ops and errors
Marc Feeley 01 Apr 1999 13:41 UTC
After staring at my "gambit.h" file which has hard-to-read deeply
nested #ifdefs, I'm warming up to the idea of a multiway if-implements
form with the logical operators (and, or, not).
It also occured to me that there is a need to signal an expansion time
error when some SRFI dependency is not satisfiable. For example:
(cond-implements
(SRFI-1 ...use SRFI-1...)
(else (expansion-error "sorry you need SRFI-1 for this program to compile")))
The form (expansion-error <string>) would be a special form which
does not evaluate its argument and stops compilation after displaying
the <string>. An alternative would be to have a syntax error in the
branch that needs to signal an error, such as:
(cond-implements
(SRFI-1 ...use SRFI-1...)
(else (foobar . "sorry you need SRFI-1 for this program to compile")))
but there is no guarantee that all Scheme implementations will signal an
error (an implementation could have extended Scheme to give (foobar . "...")
a useful meaning).
Marc