Hi John,

thank you for proposing this SRFI.

I think one has to be a bit more careful: Various procedures included in the SRFI 172 libraries can trigger the "it is an error" condition when, say, being passed incompatible values. Evaluating Scheme code that "it is an error" is no more safe than C code that causes "undefined behavior", which means it is not all safe:

(eval '(car 1) (environment '(srfi 172)))

This is not an acadamic problem. An optimizing compiler, for example, may choose not to check the types of the argument values.

To solve this problem, the SRFI 172 libraries mustn't export the standard R7RS bindings in general, but wrapped versions. One has to check that one can wrap each single procedure so that it becomes safe in all cases, in which normally the "it is an error" situation would be triggered.

A portable implementation would also have to modify "lambda", etc. so that the procedures constructed by the modified versions can always take an arbitrary number of arguments without causing undefined behavior as the following code mustn't cause undefined behavior:

(eval '(let ((f (lambda () 1))) (f 2)) (environment '(srfi 172)))

Marc