[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

multiway, logical ops and errors

This page is part of the web mail archives of SRFI 0 from before July 7th, 2015. The new archives for SRFI 0 contain all messages, not just those from before July 7th, 2015.



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