I am trying to spit a vector like [[1 2 3] [4 5 6]] into a file and later slurp it, but when I slurp it I get a string not a vector. Even if I evaluate the string I get, it is still gives a string. I tried to use (vectors slurpt-string) still it give a one element vector containing the string. Any comments?
Thanks in advance.
clojure.core/read-string
(spit "foo" [[1 2 3] [4 5 6]])
(slurp "foo") ; "[[1 2 3] [4 5 6]]"
(read-string *1) ; [[1 2 3] [4 5 6]]
(type *1) ; clojure.lang.PersistentVector
(read-string "[[1 2 3] [4 5 6]]")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With