Work on migrating to the new dictionary implementation.

This commit is contained in:
Dominik Pantůček 2023-04-09 20:36:49 +02:00
parent 42466416cd
commit ced789ca06
7 changed files with 69 additions and 68 deletions

View file

@ -41,7 +41,7 @@
(chicken format)
(chicken irregex)
testing
dictionary
util-dict-list
util-list
member-record
member-parser)
@ -76,11 +76,11 @@
(files (filter symbol? ls))
(fdict
(let loop ((files files)
(res (make-dict)))
(res (make-ldict)))
(if (null? files)
res
(loop (cdr files)
(dict-set res (car files) '()))))))
(ldict-set res (car files) '()))))))
(let loop ((links links)
(res fdict)
(errs 0))
@ -89,12 +89,12 @@
(let* ((link (car links))
(name (car link))
(target (cdr link)))
(if (dict-has-key? res target)
(if (ldict-contains? res target)
(loop (cdr links)
(dict-set res target (cons name (dict-ref res target)))
(ldict-set res target (cons name (ldict-ref res target)))
errs)
(loop (cdr links)
(dict-set res target
(ldict-set res target
(list (string->symbol (sprintf "error-~A" errs))
name))
(+ errs 1))))))))
@ -132,7 +132,7 @@
;; Returns dictionary containing only records with either 4-digit
;; name or one of its aliases being 4-digit.
(define (files-dictionary-filter-4digit-symbols d)
(dict-filter
(ldict-filter
(lambda (k v)
(list-contains-4digit-symbol? (cons k v)))
d))