From 28547d4d791e32cb52fe2c76bb429af13c9d77f9 Mon Sep 17 00:00:00 2001 From: Suzanne Soy <ligo@suzanne.soy> Date: Sun, 4 Apr 2021 07:07:17 +0100 Subject: [PATCH] WIP on a fix --- phc-adt-lib/phc-adt/node-low-level.hl.rkt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 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..17392b5 100644 --- a/phc-adt-lib/phc-adt/node-low-level.hl.rkt +++ b/phc-adt-lib/phc-adt/node-low-level.hl.rkt @@ -105,10 +105,16 @@ same if the @tc[database] and @tc[index] is the same for both nodes. (equal? (raw-node-index a) (raw-node-index b)))) (λ (a r) (fxxor (eq-hash-code (raw-node-database a)) - (r (raw-node-index a)))) + (let ([i (r (raw-node-index a))]) + (if (fixnum? i) + i + (error "index too big"))))) (λ (a r) (fxxor (eq-hash-code (raw-node-database a)) - (r (raw-node-index a)))))] + (let ([i (r (raw-node-index a))]) + (if (fixnum? i) + i + (error "index too big"))))))] The following function can then be used to test if two nodes are the same, based on the contents of their @tc[raw] field: