From 23c940c6aff145867496f113218089a0664c465f Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Mon, 10 Jan 2022 14:11:41 -0800 Subject: [PATCH] hacky shim to prevent numerical conversion in attribute --- quad/quad/qexpr.rkt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/quad/quad/qexpr.rkt b/quad/quad/qexpr.rkt index ed56f23d..77279a8b 100644 --- a/quad/quad/qexpr.rkt +++ b/quad/quad/qexpr.rkt @@ -84,9 +84,13 @@ (match-define (list k v) kv) ;; coerce number strings to actual numbers ;; this misbehaves on a list index like "1." which becomes 1.0 + ;; FIXME: we don't convert the value of key 'string + ;; on the idea that if it's "1" we don't want to make it a number. + ;; but this is dirty beyond belief (hash-set! mheq k (cond [(equal? v "true") #true] [(equal? v "false") #false] + [(eq? k 'string) v] [(string->number v)] [else v]))) (make-quad #:tag tag