From 63430887c3369142789bd4442b43949c5f4de13c Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Thu, 29 Mar 2018 22:59:08 -0700 Subject: [PATCH] Eliminate define-expr-item-compiler in favor of define-item-compiler. Not sure what I was thinking when I wrote that code; it was simply wrong. --- src/runtime/mit-syntax.scm | 2 +- src/runtime/runtime.pkg | 2 +- src/runtime/syntax-items.scm | 20 +++++--------------- 3 files changed, 7 insertions(+), 17 deletions(-) diff --git a/src/runtime/mit-syntax.scm b/src/runtime/mit-syntax.scm index c4bbf827c..8273932f5 100644 --- a/src/runtime/mit-syntax.scm +++ b/src/runtime/mit-syntax.scm @@ -341,7 +341,7 @@ USA. (name access-item-name) (env access-item-env)) -(define-expr-item-compiler access-item? +(define-item-compiler access-item? (lambda (item) (output/access-reference (access-item-name item) (compile-expr-item (access-item-env item))))) diff --git a/src/runtime/runtime.pkg b/src/runtime/runtime.pkg index ee753e9aa..f60ca108e 100644 --- a/src/runtime/runtime.pkg +++ b/src/runtime/runtime.pkg @@ -4491,7 +4491,7 @@ USA. compile-expr-item compile-item constant-item - define-expr-item-compiler + define-item-compiler defn-item defn-item-id defn-item-syntax? diff --git a/src/runtime/syntax-items.scm b/src/runtime/syntax-items.scm index b13ffb69b..72ad5548c 100644 --- a/src/runtime/syntax-items.scm +++ b/src/runtime/syntax-items.scm @@ -160,13 +160,6 @@ USA. (list predicate) (if (default-object? expr-compiler) compiler expr-compiler)))))) -(define (define-expr-item-compiler predicate compiler) - (defer-boot-action 'define-item-compiler - (lambda () - (define-predicate-dispatch-handler compile-expr-item - (list predicate) - compiler)))) - (define-item-compiler var-item? (lambda (item) (output/variable (var-item-id item)))) @@ -181,6 +174,11 @@ USA. (lambda (item) (output/sequence (map compile-expr-item (seq-item-elements item))))) +(define (illegal-expression-compiler description) + (let ((message (string description " may not be used as an expression:"))) + (lambda (item) + (error message item)))) + (define-item-compiler defn-item? (lambda (item) (let ((name (defn-item-id item)) @@ -188,14 +186,6 @@ USA. (if (defn-item-syntax? item) (output/syntax-definition name value) (output/definition name value)))) - #f) - -(define (illegal-expression-compiler description) - (let ((message (string description " may not be used as an expression:"))) - (lambda (item) - (error message item)))) - -(define-expr-item-compiler defn-item? (illegal-expression-compiler "Definition")) (define-item-compiler reserved-name-item? -- 2.25.1