Add further conversions between data-directed and code-directed programming idioms Marc Nieper-Wißkirchen (06 Jun 2020 17:25 UTC)
Low-level vs high-level exceptions Lassi Kortela (07 Jun 2020 13:59 UTC)
Re: Low-level vs high-level exceptions Marc Nieper-Wißkirchen (07 Jun 2020 15:46 UTC)
Re: Low-level vs high-level exceptions John Cowan (08 Jun 2020 14:29 UTC)
Re: Low-level vs high-level exceptions Marc Nieper-Wißkirchen (08 Jun 2020 14:36 UTC)
Re: Low-level vs high-level exceptions Marc Nieper-Wißkirchen (08 Jun 2020 14:52 UTC)
Re: Low-level vs high-level exceptions Marc Nieper-Wißkirchen (09 Jun 2020 06:11 UTC)
Re: Low-level vs high-level exceptions Wolfgang Corcoran-Mathe (09 Jun 2020 13:04 UTC)
Re: Low-level vs high-level exceptions John Cowan (14 Jun 2020 00:59 UTC)
Re: Low-level vs high-level exceptions Marc Nieper-Wißkirchen (14 Jun 2020 10:38 UTC)
Re: Low-level vs high-level exceptions John Cowan (14 Jun 2020 14:57 UTC)
Re: Low-level vs high-level exceptions Marc Nieper-Wißkirchen (14 Jun 2020 15:32 UTC)
Re: Low-level vs high-level exceptions Marc Nieper-Wißkirchen (14 Jun 2020 15:42 UTC)
Re: Low-level vs high-level exceptions John Cowan (16 Jun 2020 01:58 UTC)
Re: Low-level vs high-level exceptions Marc Nieper-Wißkirchen (16 Jun 2020 07:33 UTC)

Add further conversions between data-directed and code-directed programming idioms Marc Nieper-Wißkirchen 06 Jun 2020 17:25 UTC

* Add a procedure

(either <thunk>)

that calls thunk and returns its values wrapped into a Right except
for when <thunk> raises an exception.  In that case, wrap the error
object in a Left and return it.

The "inverse" of this procedure is `either-ref'. The name "either" is
probably not the best one.

Implementation:

(define (either thunk)
  (guard (c (else (left c))) (call-with-values thunk right)))

* Add maybe-let* that works like and-let* but can handle multiple
values and can accept #f values.

I would be willing to contribute an implementation in case Wolfgang
doesn't want to.