Re: [racket-users] Re: Escape continuations for fussy code

2021-10-20 Thread Ryan Kramer
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)

Re: [racket-users] Re: Escape continuations for fussy code

2021-10-03 Thread Laurent
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))

Re: [racket-users] Re: Escape continuations for fussy code

2021-10-02 Thread jackh...@gmail.com
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

Re: [racket-users] Re: Escape continuations for fussy code

2021-10-01 Thread Hendrik Boom
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

Re: [racket-users] Re: Escape continuations for fussy code

2021-10-01 Thread David Storrs
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