kigubkur.dig.viewer
Dig into a kigubkur© matrix by visualizing it.
view
view-in-block
(require '[kigubkur.dig [viewer :refer [view view-in-block]]])
View kigubkur© matrices and blocks
View matrices that are not blocks
=> (def r [[1 2 3 4]])
=> (def c [[1][2][3][4]])
=> (def M [[1 2 3 4 5] [1 2 3 4 5] [1 2 3 4 5] [1 2 3 4 5]])
=> (view r)
[1 2 3 4]
Order -> 1 x 4
=> (view c)
[1]
[2]
[3]
[4]
Order -> 4 x 1
=> (view M)
[1 2 3 4 5]
[1 2 3 4 5]
[1 2 3 4 5]
[1 2 3 4 5]
Order -> 4 x 5
Note that
(view nil)
will NOT work because Clojure nil represent the end-of-sequence sentinel value in the sequence protocol. Thus(count nil)
is similar to(count [])
, both returns0
.
View matrix in a block
=> (def L [[1 2 3 4 5 6 7 8 9 10]
[1 2 3 4 5 6 7 8 9 10]
[1 2 3 4 5 6 7 8 9 10]
[1 2 3 4 5 6 7 8 9 10]
[1 2 3 4 5 6 7 8 9 10]
[1 2 3 4 5 6 7 8 9 10]
[1 2 3 4 5 6 7 8 9 10]])
=> (def B (block L 5))
=> (pprint B)
[[{:A11 [[1 2 3 4 5] [1 2 3 4 5] [1 2 3 4 5] [1 2 3 4 5] [1 2 3 4 5]],
:A12
[[6 7 8 9 10] [6 7 8 9 10] [6 7 8 9 10] [6 7 8 9 10] [6 7 8 9 10]]}]
[{:A22 [[6 7 8 9 10] [6 7 8 9 10]], :A21 [[1 2 3 4 5] [1 2 3 4 5]]}]]
=> (view-in-block :A11 B)
[1 2 3 4 5]
[1 2 3 4 5]
[1 2 3 4 5]
[1 2 3 4 5]
[1 2 3 4 5]
Order -> 5 x 5
view
(view M)
View all kigubkur© matrices (by definition empty ones are not included).
view-in-block
(view-in-block ky B)
View the embedded matrix in a kigubkur© block for a given keyword.