diff options
| author | Rose Hogenson <rhogenson@posteo.net> | 2022-01-13 15:47:30 -0800 |
|---|---|---|
| committer | Rose Hogenson <rhogenson@posteo.net> | 2022-01-13 15:47:30 -0800 |
| commit | d65318dd916a3529f009e8c431b8da2df6446c0e (patch) | |
| tree | 42120edd43b518bbb9d40127b5b02e4ab75938ef /csc/linker.csc | |
| parent | Add a README. (diff) | |
| download | chromatopelma-d65318dd916a3529f009e8c431b8da2df6446c0e.tar.zst | |
Generalize the hash map.
Before we were assuming keys could be compared with eqv?. But it seems
like that assumption isn't true when we want to hold identifiers in the
hash map.
Diffstat (limited to 'csc/linker.csc')
| -rw-r--r-- | csc/linker.csc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/csc/linker.csc b/csc/linker.csc index 852ee13..b3f2a5d 100644 --- a/csc/linker.csc +++ b/csc/linker.csc @@ -41,8 +41,15 @@ (hash-bytevector (string->utf8 s))) + (define (cmp-strings s1 s2) + (cond + ((string<? s1 s2) -1) + ((string=? s1 s2) 0) + (else 1))) + + (define (make-label-map program) - (let loop ((m (make-map hash-string string<?)) + (let loop ((m (make-map hash-string cmp-strings)) (program program) (i 0)) (match program |
