delete cast

main
Matthew Butterick 9 years ago
parent bf19c4e616
commit 2adaae459c

@ -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))))

Loading…
Cancel
Save