aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Peter McGoron 2025-02-24 18:04:19 -0500
committerGravatar Peter McGoron 2025-02-24 18:04:19 -0500
commit1b34bdc78ca0e3d5e06e363dcf0eb1e10465e532 (patch)
tree02f5902d3dc85f80eddd7e47cf0449bd0b57cbe5
parentdispatch on types with multiple scopes (diff)
subtyping for local scope
-rw-r--r--SAHP.internal-common.scm6
1 files changed, 3 insertions, 3 deletions
diff --git a/SAHP.internal-common.scm b/SAHP.internal-common.scm
index edb90bc..b93cee1 100644
--- a/SAHP.internal-common.scm
+++ b/SAHP.internal-common.scm
@@ -58,7 +58,7 @@
(define (add-to-scope/subtypes scope type value)
(define (entry-is-empty-or-inherited? scope type)
- (mapping-ref scope type (lambda () #f) SAHP-entry-inherited?))
+ (mapping-ref scope type (lambda () #t) SAHP-entry-inherited?))
(define (recurse-on-subtype subtype scope)
(if (entry-is-empty-or-inherited? scope subtype)
(fold recurse-on-subtype
@@ -77,9 +77,9 @@
(define table (SAHP-global-scope SAHP-desc))
(define (empty-or-inherited? type)
(let ((entry (hash-table-ref/default table type #f)))
- (if entry
+ (if (SAHP-entry? entry)
(SAHP-entry-inherited? entry)
- #f)))
+ #t)))
(define (recurse-on-subtype subtype)
(when (empty-or-inherited? type)
(hash-table-set! table type (make-SAHP-entry value #f))