Re: Maybe macros Marc Nieper-Wißkirchen 26 Jun 2020 17:43 UTC

Am Fr., 26. Juni 2020 um 19:16 Uhr schrieb John Cowan <xxxxxx@ccil.org>:
>
> It occurred to me that it would be useful to have maybe-and, maybe-or, and maybe-and-let* macros that treat all Justs as true and Nothing as false.
>
> 1) What do people think of the idea?

I've already lobbied for maybe-and-let* (which may be abbreviated to
maybe-let*), so I am in favor of these macros.

Maybe-and-let* should unwrap the Justs when binding to the variables.

Note that we can get rid of maybe-and maybe-or if we change the
semantics of SRFI 189 and set Nothing := #f. It doesn't reduce the
expressiveness of Maybe types in any important way. Moreover, it may
help to tame the zoo of falsy values. Currently, we have #f, #<eof>,
Nothing, (). Some implementations add #<void>. This is already more
than in Javascript with False, Null, and Undefined.

> 2) Does it belong in this SRFI or should it wait for a later SRFI?

As the SRFI is not finalized yet, I would add them to this SRFI.  It
doesn't cost anything.