While this is unobjectionable in itself, it's hard to know where to stop.  One of the SRFI 145 examples is (assume (exact-integer? x) ...).  This could be changed to (assume-exact-integer x ...), but I don't think it would be very useful to add this macro to a SRFI.

Note that the second sample implementation of assume would not count as an implementation of assert (as I defined it above), but the first implementation would.

On Tue, Jun 16, 2020 at 4:29 PM Marc Nieper-Wißkirchen <xxxxxx@nieper-wisskirchen.de> wrote:
The (assume OBJ MESSAGE ...) form of SRFI 145 returns OBJ if OBJ is
not #f. Otherwise, the behavior is undefined (in other words an error
in debug or non-optimized modes).

So this uses the "truth" protocol in the language of SRFI 189. The
disadvantage, when compared to SRFI 189's "maybe" protocol, is,
obviously, that #f cannot be a regular value in this protocol.

So I am wondering whether

(assume-just MAYBE-EXPR MESSAGE ...)

is helpful when programming intensively with Maybes.

It would be equivalent to

(maybe-ref MAYBE-EXPR (lambda () (assume #f MESSAGE ...)))

So when you know that some expression X has to be a Just, you would
use (assume-just X) to get at the payload, helping optimizing
compilers.