Minor clean-up

This commit is contained in:
Simon Brooke 2019-06-24 12:22:10 +01:00
parent b91dfbb90f
commit a1e10d9cea

View file

@ -1,6 +1,5 @@
(ns sparse-array.core) (ns sparse-array.core)
(defn make-sparse-array (defn make-sparse-array
"Make a sparse array with these `dimensions`. Every member of `dimensions` "Make a sparse array with these `dimensions`. Every member of `dimensions`
must be a keyword; otherwise, `nil` will be returned." must be a keyword; otherwise, `nil` will be returned."
@ -96,7 +95,7 @@
(vector? x) (vector? x)
(if (if
(every? vector? x) (every? vector? x)
(inc (apply min (map dense-dimensions x))) (inc (apply max (map dense-dimensions x)))
1) 1)
0)) 0))
@ -160,17 +159,3 @@
(apply vector (repeat arity nil))))) (apply vector (repeat arity nil)))))
(sparse-to-dense (put (make-sparse-array :x) "hello" 4))
(def x
(put
(put
(make-sparse-array :x :y)
"hello" 3 4)
"goodbye" 4 3))
(child-arity x)
(sparse-to-dense (x 1) 4)
(sparse-to-dense x)