Yeah, Clojure's while construct isn't really good at stuff like that. A loop is the basic thing I reach for, and I'd probably write it as:
(loop [] (when-let [entry (.getNextEntry stream)] (println entry) (recur))) On Thursday, June 13, 2013 10:20:22 AM UTC-7, Josh Kamau wrote: > > Hi there ; > > How do i implement the following in clojure > > while((entry = stream.getNextEntry())!=null) { > > System.out.println(entry.getName()); > > } > > NOTE: calling getNextEntry moves the curse to the next entry. > > CONTEXT: I am trying to list the contents of a .zip file using > http://docs.oracle.com/javase/6/docs/api/java/util/zip/ZipInputStream.html > > > Regards. > > Josh > > > -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.