* make-hashtable is renamed to make-eq-hashtable, along with all
references
This commit is contained in:
parent
b24ce124b2
commit
8bfadc3a67
BIN
src/ikarus.boot
BIN
src/ikarus.boot
Binary file not shown.
|
@ -501,7 +501,7 @@
|
|||
(cond
|
||||
[(null? rhs*) '()]
|
||||
[else
|
||||
(let ([h (make-hashtable)])
|
||||
(let ([h (make-eq-hashtable)])
|
||||
(let ([ref
|
||||
(lambda (x)
|
||||
(unless (hashtable-ref h x #f)
|
||||
|
@ -519,7 +519,7 @@
|
|||
(cond
|
||||
[(null? rhs*) '()]
|
||||
[else
|
||||
(let ([h (make-hashtable)]
|
||||
(let ([h (make-eq-hashtable)]
|
||||
[rest (do-rhs* (fxadd1 i) lhs* (cdr rhs*) ref comp vref vcomp)])
|
||||
(let ([ref
|
||||
(lambda (x)
|
||||
|
@ -552,7 +552,7 @@
|
|||
(values (cons lhs slhs*) (cons rhs srhs*) llhs* lrhs* clhs* crhs*)]
|
||||
))]))
|
||||
(define (do-recbind lhs* rhs* body ref comp letrec?)
|
||||
(let ([h (make-hashtable)]
|
||||
(let ([h (make-eq-hashtable)]
|
||||
[vref (make-vector (length lhs*) #f)]
|
||||
[vcomp (make-vector (length lhs*) #f)])
|
||||
(let* ([ref (extend-hash lhs* h ref)]
|
||||
|
@ -594,7 +594,7 @@
|
|||
[(primref) x]
|
||||
[(bind lhs* rhs* body)
|
||||
(let ([rhs* (E* rhs* ref comp)])
|
||||
(let ([h (make-hashtable)])
|
||||
(let ([h (make-eq-hashtable)])
|
||||
(let ([body (E body (extend-hash lhs* h ref) comp)])
|
||||
(make-bind lhs* rhs* body))))]
|
||||
[(recbind lhs* rhs* body)
|
||||
|
@ -613,7 +613,7 @@
|
|||
(map (lambda (x)
|
||||
(record-case x
|
||||
[(clambda-case info body)
|
||||
(let ([h (make-hashtable)])
|
||||
(let ([h (make-eq-hashtable)])
|
||||
(let ([body (E body (extend-hash (case-info-args info) h ref) void)])
|
||||
(make-clambda-case info body)))]))
|
||||
cls*)
|
||||
|
|
|
@ -287,7 +287,7 @@
|
|||
[else (error 'fasl-write "~s is not fasl-writable" x)])]))))
|
||||
(define fasl-write-to-port
|
||||
(lambda (x port)
|
||||
(let ([h (make-hashtable)])
|
||||
(let ([h (make-eq-hashtable)])
|
||||
(make-graph x h)
|
||||
(write-char #\# port)
|
||||
(write-char #\@ port)
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
|
||||
(library (ikarus hash-tables)
|
||||
(export make-hashtable hashtable-ref hashtable-set! hashtable?)
|
||||
(export make-eq-hashtable hashtable-ref hashtable-set! hashtable?)
|
||||
(import
|
||||
(ikarus system $pairs)
|
||||
(ikarus system $vectors)
|
||||
(ikarus system $tcbuckets)
|
||||
(ikarus system $fx)
|
||||
(except (ikarus) make-hashtable hashtable-ref hashtable-set! hashtable?))
|
||||
(except (ikarus) make-eq-hashtable hashtable-ref hashtable-set! hashtable?))
|
||||
|
||||
(define-record hasht (vec count tc))
|
||||
|
||||
|
@ -178,10 +178,18 @@
|
|||
;;; public interface
|
||||
(define (hashtable? x) (hasht? x))
|
||||
|
||||
(define (make-hashtable)
|
||||
(let ([x (cons #f #f)])
|
||||
(let ([tc (cons x x)])
|
||||
(make-hasht (make-base-vec 32) 0 tc))))
|
||||
(define make-eq-hashtable
|
||||
(case-lambda
|
||||
[()
|
||||
(let ([x (cons #f #f)])
|
||||
(let ([tc (cons x x)])
|
||||
(make-hasht (make-base-vec 32) 0 tc)))]
|
||||
[(k)
|
||||
(if (and (or (fixnum? k) (bignum? k))
|
||||
(>= k 0))
|
||||
(make-eq-hashtable)
|
||||
(error 'make-eq-hashtable
|
||||
"invalid initial capacity ~s" k))]))
|
||||
|
||||
(define hashtable-ref
|
||||
(lambda (h x v)
|
||||
|
|
|
@ -569,7 +569,7 @@
|
|||
[else x])))
|
||||
|
||||
(define (unshare x)
|
||||
(let ([h (make-hashtable)])
|
||||
(let ([h (make-eq-hashtable)])
|
||||
(if (hasher x h)
|
||||
(rewrite-shared x h)
|
||||
x)))
|
||||
|
|
|
@ -630,13 +630,13 @@
|
|||
(dynamic x h)))
|
||||
|
||||
(define (write-to-port x p)
|
||||
(let ([h (make-hashtable)])
|
||||
(let ([h (make-eq-hashtable)])
|
||||
(hasher x h)
|
||||
(writer x p #t h 0))
|
||||
(flush-output-port p))
|
||||
|
||||
(define (display-to-port x p)
|
||||
(let ([h (make-hashtable)])
|
||||
(let ([h (make-eq-hashtable)])
|
||||
(hasher x h)
|
||||
(writer x p #f h 0))
|
||||
(flush-output-port p))
|
||||
|
|
|
@ -179,7 +179,7 @@
|
|||
(lambda (x) (eq? id (library-id x))))
|
||||
(error #f "cannot find library with spec ~s" spec))))
|
||||
|
||||
(define label->binding-table (make-hashtable))
|
||||
(define label->binding-table (make-eq-hashtable))
|
||||
|
||||
(define (install-library-record lib)
|
||||
(let ((exp-env (library-env lib)))
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
[fi (rnrs files (6))]
|
||||
[ne (null-environment)]
|
||||
[sr (rnrs sorting (6))]
|
||||
[ba (rnrs base (6))]
|
||||
[ls (rnrs lists (6))]
|
||||
[ba (rnrs base (6))]
|
||||
[is (rnrs io simple (6))]
|
||||
[bv (rnrs bytevectors (6))]
|
||||
[uc (rnrs unicode (6))]
|
||||
|
@ -678,7 +678,7 @@
|
|||
[hashtable-size S ht]
|
||||
[hashtable-update! S ht]
|
||||
[hashtable? S ht]
|
||||
[make-eq-hashtable S ht]
|
||||
[make-eq-hashtable C ht]
|
||||
[make-eqv-hashtable S ht]
|
||||
[hashtable-hash-function D ht]
|
||||
[make-hashtable D ht]
|
||||
|
|
Loading…
Reference in New Issue