trying to trace equal-hash-code with structures.
This commit is contained in:
parent
6b20b6e1fc
commit
522b1866c8
|
@ -92,9 +92,9 @@
|
|||
|
||||
Cons.prototype.hashCode = function(depth) {
|
||||
var k = baselib.hashes.getEqualHashCode("Cons");
|
||||
k += baselib.hashes.getEqualHashCode(this.first);
|
||||
k += baselib.hashes.getEqualHashCode(this.first, depth);
|
||||
k = baselib.hashes.hashMix(k);
|
||||
k += baselib.hashes.getEqualHashCode(this.rest);
|
||||
k += baselib.hashes.getEqualHashCode(this.rest, depth);
|
||||
k = baselib.hashes.hashMix(k);
|
||||
return k;
|
||||
};
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
var i;
|
||||
k = baselib.hashes.hashMix(k);
|
||||
for (i = 0; i < this._fields.length; i++) {
|
||||
k += baselib.hashes.getEqualHashCode(this._fields[i]);
|
||||
k += baselib.hashes.getEqualHashCode(this._fields[i], depth);
|
||||
k = baselib.hashes.hashMix(k);
|
||||
}
|
||||
return k;
|
||||
|
|
|
@ -48,12 +48,12 @@
|
|||
(equal-hash-code (make-thing "danny" 32))
|
||||
(equal-hash-code (shared ([a (make-thing a a)]) a))
|
||||
|
||||
;; symbols
|
||||
"symbols"
|
||||
(equal-hash-code 'hello)
|
||||
(equal-hash-code 'world)
|
||||
;; ;; symbols
|
||||
;; "symbols"
|
||||
;; (equal-hash-code 'hello)
|
||||
;; (equal-hash-code 'world)
|
||||
|
||||
;; vectors
|
||||
"vectors"
|
||||
(equal-hash-code #(1 2 3 4 5))
|
||||
(equal-hash-code (shared ([v (vector 1 2 v 3 v)]) v))
|
||||
;; ;; vectors
|
||||
;; "vectors"
|
||||
;; (equal-hash-code #(1 2 3 4 5))
|
||||
;; (equal-hash-code (shared ([v (vector 1 2 v 3 v)]) v))
|
||||
|
|
Loading…
Reference in New Issue
Block a user