aboutsummaryrefslogtreecommitdiffstats
path: root/csc/macros.csc
diff options
context:
space:
mode:
Diffstat (limited to 'csc/macros.csc')
-rw-r--r--csc/macros.csc20
1 files changed, 12 insertions, 8 deletions
diff --git a/csc/macros.csc b/csc/macros.csc
index 1edecd2..9afeea9 100644
--- a/csc/macros.csc
+++ b/csc/macros.csc
@@ -17,6 +17,7 @@
insert
key-not-found-error?
lookup
+ make-comparer
map-for-each
merge)
(only (csc ir1)
@@ -383,17 +384,20 @@
finally (return (< (length m1) (length m2)))))
- (define (cmp-identifiers i1 i2)
- (cond
- ((bound-identifier=? i1 i2) 0)
- ((or (string<? (symbol->string (identifier-name i1)) (symbol->string (identifier-name i2)))
- (marks<? (marks i1) (marks i2)))
- -1)
- (else 1)))
+ (define compare-identifiers
+ (make-comparer
+ hash-identifier
+ (lambda (i1 i2)
+ (cond
+ ((bound-identifier=? i1 i2) 0)
+ ((or (string<? (symbol->string (identifier-name i1)) (symbol->string (identifier-name i2)))
+ (marks<? (marks i1) (marks i2)))
+ -1)
+ (else 1)))))
(define (alist->substitutions l)
- (alist->map hash-identifier cmp-identifiers l))
+ (alist->map compare-identifiers l))
(define (is-underscore expression)