Or,
#lang racket (require (for-syntax ) racket/stxparam) (define-syntax-parameter return (syntax-rules ())) (define-syntax-parameter false (syntax-rules ())) (define-syntax fn (syntax-rules () [(_ (arg ...) body ...) (λ (arg ...) (let/cc fn-exit (syntax-parameterize ([return (syntax-rules () [(_ x) (fn-exit x)])]) (syntax-parameterize ([false (syntax-rules () [(_) (return #f)])]) body ...))))])) ((fn (x y) (when (< x y) (return x)) y) 2 30) ; => 2 ((fn (x y) (when (< x y) (false)) y) 2 30) ;=> #f -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/B99E2A20-68EE-46C3-B8F4-2066F3C063CD%40felleisen.org. For more options, visit https://groups.google.com/d/optout.