crossing out a few hash functions from my todo list

This commit is contained in:
Danny Yoo 2011-11-07 17:46:31 -05:00
parent 923d418840
commit a273a12091
6 changed files with 37 additions and 2 deletions

View File

@ -90,6 +90,8 @@
'prop:exn:srclocs 'prop:exn:srclocs
'hash? 'hash?
'hash-eq?
'hash-eqv?
'make-hash 'make-hash
'make-hasheqv 'make-hasheqv
'make-hasheq 'make-hasheq

View File

@ -349,11 +349,11 @@
}; };
var isHashEqv = function (x) { var isHashEqv = function (x) {
return (x instanceof WhalesongHashtable || x instanceof WhalesongImmutableHashtable) && x.type === 'eqv'; return (x instanceof WhalesongHashtable || x instanceof WhalesongImmutableHashtable) && x.type === 'hasheqv';
}; };
var isHashEq = function (x) { var isHashEq = function (x) {
return (x instanceof WhalesongHashtable || x instanceof WhalesongImmutableHashtable) && x.type === 'eq'; return (x instanceof WhalesongHashtable || x instanceof WhalesongImmutableHashtable) && x.type === 'hasheq';
}; };

View File

@ -2516,6 +2516,19 @@
function(M) { function(M) {
return baselib.hashes.isHash(checkAny(M, 'hash?', 0)); return baselib.hashes.isHash(checkAny(M, 'hash?', 0));
}); });
installPrimitiveProcedure(
'hash-eq?',
1,
function(M) {
return baselib.hashes.isHashEq(checkAny(M, 'hash-eq?', 0));
});
installPrimitiveProcedure(
'hash-eqv?',
1,
function(M) {
return baselib.hashes.isHashEqv(checkAny(M, 'hash-eqv?', 0));
});
installPrimitiveProcedure( installPrimitiveProcedure(
'make-hasheq', 'make-hasheq',

View File

@ -150,6 +150,8 @@
with-continuation-mark with-continuation-mark
hash? hash?
hash-eq?
hash-eqv?
make-hash make-hash
make-hasheqv make-hasheqv
make-hasheq make-hasheq

View File

@ -21,6 +21,15 @@ not-found
1 1
1 1
1 1
true
true
true
false
true
false
false
false
true
danny danny
dyoo@hashcollision.org dyoo@hashcollision.org
unknown unknown

View File

@ -64,6 +64,15 @@
(hash-ref ht "test!") (hash-ref ht "test!")
(hash? (make-immutable-hash))
(hash? (make-immutable-hasheq))
(hash? (make-immutable-hasheqv))
(hash-eq? (make-immutable-hash))
(hash-eq? (make-immutable-hasheq))
(hash-eq? (make-immutable-hasheqv))
(hash-eqv? (make-immutable-hash))
(hash-eqv? (make-immutable-hasheq))
(hash-eqv? (make-immutable-hasheqv))
(let* ([ht (make-immutable-hash)] (let* ([ht (make-immutable-hash)]
[ht (hash-set ht 'name "danny")] [ht (hash-set ht 'name "danny")]
[ht (hash-set ht 'email "dyoo@hashcollision.org")]) [ht (hash-set ht 'email "dyoo@hashcollision.org")])