From 2adaae459cad1bfdd9de989d8d331a0c3adb6386 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Mon, 23 Mar 2015 19:31:45 -0700 Subject: [PATCH] delete cast --- quad/quads-typed.rkt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/quad/quads-typed.rkt b/quad/quads-typed.rkt index 1343b025..6ec0907a 100644 --- a/quad/quads-typed.rkt +++ b/quad/quads-typed.rkt @@ -171,10 +171,9 @@ (let-values ([(ks vs even?) (for/fold ([ks : (Listof QuadAttrKey) null][vs : (Listof QuadAttrValue) null][even? : Boolean #t]) ([x (in-list xs)]) - (if even? - ;; todo: how to avoid cast here by using HashableList typing? - (values (cons (cast x QuadAttrKey) ks) vs #f) - (values ks (cons (cast x QuadAttrValue) vs) #t)))]) + (if (and even? (QuadAttrKey? x)) + (values (cons x ks) vs #f) + (values ks (cons x vs) #t)))]) (when (not even?) (error 'quadattrs "odd number of elements in ~a" xs)) (for/hash : QuadAttrs ([k (in-list ks)][v (in-list vs)]) (values k v))))