pull/21/head
Matthew Butterick 5 years ago
parent 0b24352082
commit 081561e9cd

@ -19,10 +19,11 @@
#'(make-hash (list (cons K V) ...))) #'(make-hash (list (cons K V) ...)))
(define-macro (func-def (ARG ...) STMT ...) (define-macro (func-def (ARG ...) STMT ...)
#'(λ (ARG ...) (syntax/loc caller-stx
(λ (ARG ...)
(let/cc return-cc (let/cc return-cc
(syntax-parameterize ([return (make-rename-transformer #'return-cc)]) (syntax-parameterize ([return (make-rename-transformer #'return-cc)])
STMT ... (void))))) STMT ... (void))))))
(define-syntax-parameter return (define-syntax-parameter return
(λ (stx) (error 'not-parameterized))) (λ (stx) (error 'not-parameterized)))

@ -14,7 +14,7 @@ var thing = {
}; };
thing.foo; // prints 42 thing.foo; // prints 42
thing.bar; // prints #<procedure:...> thing.bar; // prints #<procedure:...test.rkt:11:12>
thing.bar(3); // prints 18 thing.bar(3); // prints 18
if ( thing.foo == 42 ) { if ( thing.foo == 42 ) {

Loading…
Cancel
Save