(module section-5-exceptions-3 mzscheme (require (planet "reduction-semantics.ss" ("robby" "redex.plt" 2)) (prefix natural-embedding: "section-3-natural-embedding-1.ss") "core-calculi.ss" "section-5-exceptions-base.ss" "language-composer-tools.ss") (provide (all-defined)) ;; ============================================================ ;; LANGUAGE GRAMMARS (define ms (grammar-union base natural-embedding:simple-natural-embedding-extensions exceptions-base)) ;; ------------------------------------------------------------ ;; DYNAMIC SEMANTICS (define exns3-scheme-reductions (list (reduction ms (in-named-hole s E_1 (handle s:e_handler (in-named-hole s s:nhc (wrong string)))) (term (in-hole E_1 s:e_handler))) (reduction ms (in-named-hole s E_1 (GSM m:ty (in-named-hole m m:nhc (raise m:ty string_1)))) (term (in-hole E_1 (wrong string_1)))))) (define exns3-ml-reductions (list (reduction ms (in-named-hole m E_1 (handle m:e_handler (in-named-hole m m:nhc (raise m:ty string)))) (term (in-hole E_1 m:e_handler))) (reduction ms (in-named-hole m m:nhc (raise m:ty string_1)) (term string_1)) (reduction ms (in-named-hole m E_1 (MSG m:ty_1 (in-named-hole s s:nhc (wrong string_1)))) (term (in-hole E_1 (raise m:ty_1 string_1)))))) (define reductions (append (base-scheme-reductions/no-wrong ms) (natural-embedding:natural-embedding-scheme-reductions ms) (exceptions-base-scheme-reductions ms) exns3-scheme-reductions (base-ml-reductions ms) (natural-embedding:natural-embedding-ml-reductions ms) (exceptions-base-ml-reductions ms) exns3-ml-reductions)) ;; ============================================================ ;; TESTS (define-values (gui E N1 N2) (get-evaluators ms m:typeof reductions error-message?)))