Am So., 30. Juli 2023 um 23:36 Uhr schrieb John Cowan <[email protected]>: > > > > On Sun, Jul 30, 2023 at 4:49 PM Marc Nieper-Wißkirchen > <[email protected]> wrote: > >> >> I would like to point out that using SRFI 145 is also a possibility. >> The idea of SRFI 145's "assume" is that it raises an exception if the >> assumption is not fulfilled when the compiler is not used with an >> unsafe optimization flag. > > > It *can* do that, but it is not a requirement of the SRFI. "Assume" returns > its argument if that argument is true. If the argument is false, its > behavior is unpredictable. There is nothing about unsafe flags. It is an > expression that gives you access to the compiler's handling of "is an error" > behavior, whatever it may be: an exception, a crash, demons flying out of > your nose.
And this is exactly what we ultimately want. If you want to run your Scheme system at maximal speed and your program is already debugged, turn on the unsafe mode of the Scheme implementation; otherwise, turn on the safe mode. Using "assume" makes your library behave exactly as all standard R7RS-small libraries.
