assume-just Marc Nieper-WiÃkirchen 16 Jun 2020 20:28 UTC
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.