From: Matt Birkholz Date: Sat, 7 Jan 2012 19:07:22 +0000 (-0700) Subject: cref: Replace hash-tables with alists. X-Git-Tag: release-9.2.0~334^2~26^2^2 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=f0c2e35b6d032f3ccb45858229a9d37e379ebbf4;p=mit-scheme.git cref: Replace hash-tables with alists. A strong-eq-hash-table seems like overkill now. --- diff --git a/src/cref/object.scm b/src/cref/object.scm index 1d10d6090..5b95f4ac5 100644 --- a/src/cref/object.scm +++ b/src/cref/object.scm @@ -59,8 +59,8 @@ USA. (files '()) parent (children '()) - (%bindings (make-strong-eq-hash-table) read-only #t) - (%references (make-strong-eq-hash-table) read-only #t) + (%bindings '()) + (%references '()) (links '())) (define-integrable (package/n-files package) @@ -70,22 +70,26 @@ USA. (null? (package/name package))) (define-integrable (package/find-reference package name) - (hash-table/get (package/%references package) name #f)) + (let ((entry (assq name (package/%references package)))) + (and entry (cdr entry)))) (define-integrable (package/put-reference! package name reference) - (hash-table/put! (package/%references package) name reference)) + (set-package/%references! package (cons (cons name reference) + (package/%references package)))) (define-integrable (package/find-binding package name) - (hash-table/get (package/%bindings package) name #f)) + (let ((entry (assq name (package/%bindings package)))) + (and entry (cdr entry)))) (define-integrable (package/put-binding! package name binding) - (hash-table/put! (package/%bindings package) name binding)) + (set-package/%bindings! package (cons (cons name binding) + (package/%bindings package)))) (define-integrable (package/bindings package) - (hash-table/datum-list (package/%bindings package))) + (map cdr (package/%bindings package))) (define-integrable (package/references package) - (hash-table/datum-list (package/%references package))) + (map cdr (package/%references package))) (define-integrable (file-case/type file-case) (car file-case))