From e0cc0cd65e9012c9327f3d20f3737ffe166b24ea Mon Sep 17 00:00:00 2001 From: Sam Tobin-Hochstadt Date: Wed, 6 Nov 2019 13:27:58 -0500 Subject: [PATCH] Handle Integer instead of Fixnum for hash-code computation. Now that these are type checked by Typed Racket in 7.5, it's a problem that the documentation doesn't promise that these will be a Fixnum. Switch to using Integer, and change the use of fxxor to match. --- phc-adt-lib/phc-adt/node-low-level.hl.rkt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phc-adt-lib/phc-adt/node-low-level.hl.rkt b/phc-adt-lib/phc-adt/node-low-level.hl.rkt index 27dfe80..3f578d5 100644 --- a/phc-adt-lib/phc-adt/node-low-level.hl.rkt +++ b/phc-adt-lib/phc-adt/node-low-level.hl.rkt @@ -221,7 +221,7 @@ them with a special marker. @chunk[ (: node-hash (∀ (fieldᵢ/τ …) - (→ (node-id fieldᵢ/τ … Any Any) (→ Any Fixnum) Fixnum))) + (→ (node-id fieldᵢ/τ … Any Any) (→ Any Integer) Integer))) (define (node-hash nd racket-recur-hash) (if (eq? (raw-node-database ((struct-accessor node-id raw) nd)) 'unique-copy) @@ -275,9 +275,9 @@ To combine hash codes, we simply compute their @elem[#:style 'tt]{xor}. Later versions of this library may use more sophisticated mechanisms. @chunk[ - (: combine-hash-codes (→ Fixnum * Fixnum)) + (: combine-hash-codes (→ Integer * Integer)) (define (combine-hash-codes . fixnums) - (apply fxxor fixnums))] + (apply bitwise-xor fixnums))] @subsection{Caching node equality}