> On Jun 3, 2019, at 8:51 AM, Matthias Felleisen <matth...@felleisen.org> wrote:
>
>
> My code run your examples. Whay is missinng?
>
Here’s what I’ve been trying to run.
#lang racket
(require (for-syntax racket/syntax)
racket/stxparam)
(define-syntax-parameter false
(lambda (stx)
(raise-syntax-error (syntax-e stx) "can only be used inside lambda.")))
(define-syntax (fn stx)
(syntax-case stx ()
[(_ (arg ...) body0 body ...)
(with-syntax ([return (format-id #'body0 "~a" #'return)])
#'(λ (arg ...) (let/cc return
(syntax-parameterize ([false #'return]) body0 body
...))))]))
((fn (x y) (when (< x y) (return x)) y) 2 30) ; => 2
((fn (x y) (when (< x y) (false)) y) 2 30)
Kevin
--
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/CC4AB8E6-76E4-43C3-9D2D-497F7467B858%40gmail.com.
For more options, visit https://groups.google.com/d/optout.