Re: DISCUSS: clojure.contrib.java-utils/file

2009-04-07 Thread Stuart Sierra
Yeah, I'm thinking of renaming duck-streams/file to something like file-str or filename. -Stuart Sierra On Apr 7, 1:13 am, samppi wrote: > In addition, it's a bad idea to have these two superficially similar > functions have the same name, "file". If, in the end, both are to be > kept public, th

Re: DISCUSS: clojure.contrib.java-utils/file

2009-04-06 Thread samppi
In addition, it's a bad idea to have these two superficially similar functions have the same name, "file". If, in the end, both are to be kept public, then I think they should at least be given different names. On Apr 6, 10:35 am, Victor Rodriguez wrote: > Hello, > > On Mon, Apr 6, 2009 at 10:06

Re: DISCUSS: clojure.contrib.java-utils/file

2009-04-06 Thread Victor Rodriguez
Hello, On Mon, Apr 6, 2009 at 10:06 AM, James Reeves wrote: > ... > The problem with having java-utils/file and duck-streams/file is that > you lose the ability to load both namespaces at the same time without > defining an exception for the file function. This does not seem like > an ideal solu

Re: DISCUSS: clojure.contrib.java-utils/file

2009-04-06 Thread Jason Sankey
James Reeves wrote: > On Apr 6, 11:29 am, Jason Sankey wrote: >> I think there may be a misunderstanding over "combining" here - I read >> Stuart's mail to mean there was no obvious way to combine >> duck-streams/file and java-utils/file, whereas this implementation shows >> java-utils/file style

Re: DISCUSS: clojure.contrib.java-utils/file

2009-04-06 Thread James Reeves
On Apr 6, 11:29 am, Jason Sankey wrote: > I think there may be a misunderstanding over "combining" here - I read > Stuart's mail to mean there was no obvious way to combine > duck-streams/file and java-utils/file, whereas this implementation shows > java-utils/file style behaviour only? As far a

Re: DISCUSS: clojure.contrib.java-utils/file

2009-04-06 Thread Jason Sankey
James Reeves wrote: > On Apr 6, 4:10 am, Stuart Sierra wrote: >> I don't see an obvious way of combining them. > > What about something like: > > (defn- normalize-separator > [filepath] > (.. (str filepath) > (replace \\ File/separatorChar) > (replace \/ File/separatorChar))) > > (

Re: DISCUSS: clojure.contrib.java-utils/file

2009-04-06 Thread Michael Wood
On Mon, Apr 6, 2009 at 10:40 AM, James Reeves wrote: > > On Apr 6, 4:10 am, Stuart Sierra wrote: >> I don't see an obvious way of combining them. > > What about something like: > > (defn- normalize-separator >  [filepath] >  (.. (str filepath) >    (replace \\ File/separatorChar) >    (replace \

Re: DISCUSS: clojure.contrib.java-utils/file

2009-04-06 Thread James Reeves
On Apr 6, 4:10 am, Stuart Sierra wrote: > I don't see an obvious way of combining them. What about something like: (defn- normalize-separator [filepath] (.. (str filepath) (replace \\ File/separatorChar) (replace \/ File/separatorChar))) (defn file [filepath & more] (reduce

Re: DISCUSS: clojure.contrib.java-utils/file

2009-04-05 Thread Stuart Halloway
Good summary. Let's keep them separate until we feel pain. - Stuart Halloway > They work rather differently. duck-streams/file treats all arguments > as strings, so > (file "foo" "bar") => > I wrote it that way because I often want to construct a file name like > (file base "." extension) >

Re: DISCUSS: clojure.contrib.java-utils/file

2009-04-05 Thread Stuart Sierra
They work rather differently. duck-streams/file treats all arguments as strings, so (file "foo" "bar") => I wrote it that way because I often want to construct a file name like (file base "." extension) java-utils/file is closer to the Java File interface, by assuming that each argument is a

Re: DISCUSS: clojure.contrib.java-utils/file

2009-04-05 Thread James Reeves
I'd like it if they were combined. You could then use (file "foo/bar") or (file "foo" "bar"). - James On Apr 5, 9:25 pm, Stuart Halloway wrote: > Doh! Missed that. The duck-streams and java-utils versions of file   > have overlapping but disjoint functionality. Other-Stuart, I can take   > a lo

Re: DISCUSS: clojure.contrib.java-utils/file

2009-04-05 Thread Stuart Halloway
Doh! Missed that. The duck-streams and java-utils versions of file have overlapping but disjoint functionality. Other-Stuart, I can take a look at combining these, or we can just leave them separate for now. --Stuart > On Apr 5, 5:07 pm, Stuart Halloway wrote: >> Never worry about "foo" vs.

Re: DISCUSS: clojure.contrib.java-utils/file

2009-04-05 Thread James Reeves
On Apr 5, 5:07 pm, Stuart Halloway wrote: > Never worry about "foo" vs. (File. "foo") again! > > (doc file) > - > clojure.contrib.java-utils/file > ([arg] [parent child] [parent child & more]) >    Returns a java.io.File from string or file args. > > Notes: > > (1) You w

DISCUSS: clojure.contrib.java-utils/file

2009-04-05 Thread Stuart Halloway
Never worry about "foo" vs. (File. "foo") again! (doc file) - clojure.contrib.java-utils/file ([arg] [parent child] [parent child & more]) Returns a java.io.File from string or file args. Notes: (1) You will need to build contrib from source to see this. (2) This fu