Using enumeration-seq does the trick!  Thanks.

user=> (enumeration-seq (.entries (java.util.zip.ZipFile. "<path to some
jar>")))

On Mon, Dec 15, 2008 at 5:14 PM, Rich Hickey <[email protected]> wrote:

>
>
>
> On Dec 15, 6:01 pm, "Brian Doyle" <[email protected]> wrote:
> > According to the docs the seq function should be able to take an
> > enumeration,
> > but here is what I see:
> >
> > user=> (seq (.elements (doto (java.util.Vector.) (.add "hello") (.add
> > "world"))))
> > java.lang.IllegalArgumentException: Don't know how to create ISeq
> > from:  (NO_SOURCE_FILE:0)
> >
>
> If you really want to create a seq on an Enumeration you have to use
> enumeration-seq. But there is no need to explicitly obtain
> enumerations/iterators for Collections (and Vector implements
> Collection):
>
> (seq (doto (java.util.Vector.) (.add "hello") (.add "world")))
> -> ("hello" "world")
>
> Note also that Collections have constructors from Collections, and
> Clojure vectors are Collections:
>
> (seq (java.util.Vector. ["hello" "world"]))
> -> ("hello" "world")
>
> Rich
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to