How do I use Zip in Clojure? -
I'm pretty new to the closure zip utility looks interesting, but I can not use it.
I tried
;; (DIP Dies (zip / vector-zip data))
(DIP data '[[a * b] + [c * d]] I'm getting
< Pre> java.lang.Exception: There is no such name: ZIP
How do you use external libraries?
You can confuse two different methods of importing the code. You can do this:
User & gt; (Use 'Clojure.zip)
Or when you are declaring a namespace in a source file:
(ns foo (: clojure) .zip))
The second version is the macro that has been expanded in the past.
(ns)
outside, (: use "zip")
is going to treat : usage
Call the function as its parameter and call it from "zip"
(i.e. string "zip"
) as a collection and try to use the key see: use
in it), which does nothing.
clojure.zip
has some functions in whose names there is a conflict with things in clojure.core
, so you have to do something like that :
User & gt; (Use '(Closer [Zip: Rename] Change next-zip next place - Remove zip delete-zip}]))
or preference this:
Users & gt;
With the later you can refer to functions such as (zip / vector-zip data) < / Code> as you wish
See the documentation for the page you are talking about.
Comments
Post a Comment