Add further conversions between data-directed and code-directed programming idioms Marc Nieper-Wißkirchen 06 Jun 2020 17:25 UTC
Re: Add further conversions between data-directed and code-directed programming idioms John Cowan 06 Jun 2020 23:27 UTC
Re: Add further conversions between data-directed and code-directed programming idioms Marc Nieper-Wißkirchen 07 Jun 2020 09:13 UTC
Re: Add further conversions between data-directed and code-directed programming idioms Lassi Kortela 07 Jun 2020 12:18 UTC
Re: Add further conversions between data-directed and code-directed programming idioms Marc Nieper-Wißkirchen 07 Jun 2020 13: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:45 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:03 UTC
Re: Low-level vs high-level exceptions John Cowan 14 Jun 2020 00:58 UTC
Re: Low-level vs high-level exceptions Marc Nieper-Wißkirchen 14 Jun 2020 10:37 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:31 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.