I would use loop/recur something like this:
(loop [item (get-next-entry)] (when item (do (do-something) (recur (get-next-entry)))) On Thu, Jun 13, 2013 at 2:20 PM, Josh Kamau <joshnet2...@gmail.com> 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. > > > -- -- 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.