From 98f12121fac8a5e2be1bc65a52778a463e6ff688 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Wed, 6 Apr 2022 14:46:54 -0700 Subject: [PATCH] convert immutable hashes --- quad2/quad.rkt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/quad2/quad.rkt b/quad2/quad.rkt index d23e1ff8..f9e0605e 100644 --- a/quad2/quad.rkt +++ b/quad2/quad.rkt @@ -42,7 +42,8 @@ #:attrs [attrs (make-quad-attrs null)] #:elems [elems null]) (() (#:tag quad-tag? #:attrs quad-attrs? #:elems quad-elems?) . ->* . quad?) - (quad-constructor tag attrs elems #false)) + (let ([attrs (if (immutable? attrs) (make-hasheq (hash->list attrs)) attrs)]) + (quad-constructor tag attrs elems #false))) (define (quad-ref q key [default-val #false]) (hash-ref (quad-attrs q) key default-val))