(define DYNAMIC-CATCH (rlambda [call env esc cont] (cont (normalize (arg 1 call) env esc id)))) (define DYNAMIC-THROW (rlambda [call env esc cont] (normalize (arg 1 call) env esc id))) (define DEFINE-CATCH (mlambda [call] (let [[name (acons)]] '(catch ,name (begin (define ,(arg 1 call) (lambda [arg] (,name arg))) ,(arg 2 call)))))) ;;; for example: (define read-3-lisp (lambda [string] (init-lex string) (let [[answer (define-catch ERROR-IN-RECOGNITION (read-expression))]] (if (and (not (= answer $false)) (= (next-token) 'eot)) answer $false))))