[plt-scheme] to define, or to let (new twist)

From: Paul Schlie (schlie at comcast.net)
Date: Tue Mar 23 16:34:08 EST 2004

How about this one:

All expressions should yield values, and treat all unexpected argument
type/values in a well defined as innocuous manner as possible consistent
with the semantics of the expression (which may include issuing diagnostic
messages), but under no circumstance should the program be halted upon the
receipt of a diagnostic error/warning (unless instructed to do so); as a
halted program is more likely to lead to catastrophic consequences, than a
running program in the presence of unexpected data. (if more sophisticated
error recovery is desired, it can/should be enabled though an ability of a
supervisor thread to intercept issued error/warning diagnostic messages and
take whatever appropriate action deemed appropriate).

For example (hypothetically):

Functions/Macros when evaluating unexpected arguments should post a warning
to some well defined <error-stream> and return a close approximation of the
functions normal semantics as reasonably possible, or a <void>. For example:

 (+ <void>) -> <void>
 (+ 2 3 <void>) -> 5
 (define <void> ...) -> <void> ; no effect.

How's that for controversial (maybe not ideal, but closer than not).


Posted on the users mailing list.