I realize that's just an example, but I wouldn't expect to need anything other than interop to do this (off the top, maybe java.nio.file.Path can be constructed directly?):
(defn normalize-path [& rest] (-> (reduce #(new java.io.File %1 %2) rest) .toPath .normalize)) On Tue, Nov 19, 2013 at 8:22 AM, Brian Craft <craft.br...@gmail.com> wrote: > > > On Monday, November 18, 2013 3:58:10 PM UTC-8, kovasb wrote: >> >> There are a large number of high quality libraries like instaparse, >> cascalog, storm, overtone, friend, etc. I find it pretty easy to tell >> the difference between a hobby and production project. Besides the >> typically liveliness measures, its also helpful to know the reputation >> (or lack thereof) of the people behind the projects. >> > > Yes, there are these fairly advanced libraries in very specific domains, > but the core libraries are extremely weak. > > For example, I have a project with rather modest requirements, one of them > being abstract path manipulation. In javascript: > > path.normalize(path.join("one", "two", "..", "three")) > 'one/three' > > ruby: > > irb(main):003:0> Pathname.new("one") + "two" + ".." + "three" > => #<Pathname:one/three> > > python: > > >>> os.path.normpath(os.path.join("one", "two", "..", "three")) > 'one/three' > > In clojure, people recommend me.raynes.fs: > > => (fs/file "one" "two" ".." "three") > #<File /inside/home/craft/cavm/one/two/../three> > > ugh. > > => (fs/normalized-path (fs/file "one" "two" ".." "three")) > #<File /inside/home/craft/cavm/one/three> > > um, no. Turns out there is no abstract path join + normalization in > me.raynes.fs. I haven't found an alternative in clojure. > > This is trivial to work around, but I hit this kind of thing constantly > with every clojure library I use: clojure libraries are about 70% > implemented, and 90% correct, which makes a weak foundation. I was amused > to find the Lisp Curse article a few weeks ago, which describes this > situation. It's often easier to write something from scratch than to > patch one of the partially-implemented libraries. But this scales poorly, > and one is truly starting from zero with clojure. > > Of course clojure is a relatively new language, with a much smaller number > of users than javascript, python, and ruby, so I expect the libraries to be > less complete. What I don't expect is clojure users to report that the > libraries are just great. Clojure libraries are very weak compared to other > modern languages. > > -- > -- > 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.