commit 28547d4d791e32cb52fe2c76bb429af13c9d77f9 parent 7364ed6b2935b6f142f64575d5b2743b48fa0545 Author: Suzanne Soy <ligo@suzanne.soy> Date: Sun, 4 Apr 2021 07:07:17 +0100 WIP on a fix Diffstat:
| M | 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 @@ -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: