From f0c2e35b6d032f3ccb45858229a9d37e379ebbf4 Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Sat, 7 Jan 2012 12:07:22 -0700 Subject: [PATCH] cref: Replace hash-tables with alists. A strong-eq-hash-table seems like overkill now. --- src/cref/object.scm | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) 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)) -- 2.25.1