On Feb 1, 6:23 pm, OGINO Masanori <masanori.og...@gmail.com> wrote:
> Hello.
>
> I built master branch of clojure and clojure-contrib and then I found
> that there is no duck-streams.  io exists.
>
> Can I write a code on both 1.1 and master using duck-streams/io?
>
> FYI, I want something like this Python code in Clojure:
>
>     try:
>         from clojure.contrib.io import reader, writer
>     except ImportError:
>         from clojure.contrib.duck-streams import reader, writer
>
> Thanks.
>
> --
> Name:  OGINO Masanori (荻野 雅紀)
> E-mail: masanori.og...@gmail.com


(try
  (require '(clojure.contrib [io :only [reader writer]]))
  (catch Exception e
    (require '(clojure.contrib [duck-streams :only [reader
writer]]))))

And yes, I had to go through a few iterations 'til I got a version
that worked.

-- 
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

Reply via email to