I guess I'll pile on too. My approach was `let++` which I rename to `let*`
because (I think) it is backwards compatible. The pattern for early exit is
`#:break (when test-expr result-expr)` so the previous example would look
like this:
(let* (#:break (when (not (foo? x))
#f)
Oh well, since everyone is at it, here's my version that no-one asked for.
It's similar to parendown, but uses a more standard (but also specific)
macro `cond/else` from
https://github.com/Metaxal/bazaar/blob/master/cond-else.rkt :
(*cond/else*
[(*not* (foo? x)) #f]
#:else
(*define* y (bar x))
Here's my solution:
(define/guard (f x)
(guard (foo? x) else
#false)
(define y (bar x))
(define z (jazz x y))
(guard (loopy? z) else
#false)
(define a (yowza z))
(guard (string? a) else
(error 'ugh))
(define b (bonkers a))
(guard (number? (hoop x b)) else
(error
On Fri, Oct 01, 2021 at 02:32:52PM -0400, David Storrs wrote:
> On Fri, Oct 1, 2021 at 11:58 AM Hendrik Boom wrote:
>
> > On Fri, Oct 01, 2021 at 02:22:14PM +, Jesse Alama wrote:
> > > Hello,
> > >
> > > Have you ever wished you could do a C-style return in the middle
> > > of a block of
On Fri, Oct 1, 2021 at 11:58 AM Hendrik Boom wrote:
> On Fri, Oct 01, 2021 at 02:22:14PM +, Jesse Alama wrote:
> > Hello,
> >
> > Have you ever wished you could do a C-style return in the middle
> > of a block of Racket code? When you're in the heat of things with
> > a complicated problem
5 matches
Mail list logo