[racket-users] Re: Help implementing an early return macro

2020-11-04 Thread jackh...@gmail.com
A brief update on this: I went with Ryan's approach and used an implementation of guarded-block throughout Rebellion's codebase. You can see the diff here: https://github.com/jackfirth/rebellion/pull/466. A couple of things to note: - I added a define/guard form that's like define, but with

[racket-users] Re: Help implementing an early return macro

2020-11-01 Thread George Neuner
On Sat, 31 Oct 2020 03:25:32 -0700 (PDT), "jackh...@gmail.com" wrote: >Wow, these are a lot of great responses. First of all, *awesome* job Ryan. >That implementation is exactly what I needed to figure out. I'm definitely >starting there first. > >> Are you looking for `let/ec`? > >I'd

Re: [racket-users] Re: Help implementing an early return macro

2020-10-31 Thread jackh...@gmail.com
Wow, these are a lot of great responses. First of all, *awesome* job Ryan. That implementation is exactly what I needed to figure out. I'm definitely starting there first. > Are you looking for `let/ec`? I'd forgotten about that one. That has the *syntax* I want. However my issue with

Re: [racket-users] Re: Help implementing an early return macro

2020-10-28 Thread Dominik Pantůček
Hi racketeers, I would second this suggestion. Although it might look slightly un-rackety at first sight, for certain types of code flow it does the job really well. And most importantly - I am using escape continuations in much wilder setup (yes, futures) and it imposes no noticeable

[racket-users] Re: Help implementing an early return macro

2020-10-28 Thread Alex Harsanyi
Are you looking for `let/ec`? (let/ec return (define x (random 10)) (unless (even? x) (log-info "x wasn't even, x = ~a" x) (return -1)) (define y (random 10)) (unless (even? y) (log-info "y wasn't even, y = ~a" y) (return -1)) (+ x y)) Alex. On Wednesday, October 28,