aboutsummaryrefslogtreecommitdiffstats
path: root/csc/cps.csc
diff options
context:
space:
mode:
authorRose Hogenson <rhogenson@posteo.net>2022-07-24 16:20:00 -0700
committerRose Hogenson <rhogenson@posteo.net>2022-07-24 16:20:00 -0700
commitc04e3c7cd6726a95da3d58979f582afb7a5b722f (patch)
tree524f25bb188f90d68626a1f402f8de54e00848d4 /csc/cps.csc
parentc6b74224fe669bc9d180a409ad13ed269631b316 (diff)
downloadchromatopelma-c04e3c7cd6726a95da3d58979f582afb7a5b722f.tar.zst
Export some common comparers from hash-map.
Diffstat (limited to 'csc/cps.csc')
-rw-r--r--csc/cps.csc9
1 files changed, 7 insertions, 2 deletions
diff --git a/csc/cps.csc b/csc/cps.csc
index e7f0fe6..81ba933 100644
--- a/csc/cps.csc
+++ b/csc/cps.csc
@@ -10,6 +10,7 @@
insert
key-not-found-error?
lookup
+ make-comparer
make-map
map->alist
merge)
@@ -315,14 +316,18 @@
(_ (error "unexpected type in to-cps" expr))))
- (define (make-ref-map)
- (make-map
+ (define compare-refs
+ (make-comparer
(lambda (ref)
(gensym->int (lexical-ref-gensym ref)))
(lambda (x y)
(- (gensym->int (lexical-ref-gensym y)) (gensym->int (lexical-ref-gensym x))))))
+ (define (make-ref-map)
+ (make-map compare-refs))
+
+
(define (get-boxed expr)
(match expr
((% %update ref _ continuation)