Re: How can I find all files ending with .clj, for example

2009-01-08 Thread wubbie
thank, it was str as usual. On Jan 8, 9:22 pm, "Brian Doyle" wrote: > This works: > > (filter #(re-find #"\.clj$" (str %)) (file-seq(java.io.File. "."))) > > On Thu, Jan 8, 2009 at 7:16 PM, wubbie wrote: > > > I tried > > >  (filter #(re-find #"\.clj$" %) (seq (file-seq(java.io.File. "." >

Re: How can I find all files ending with .clj, for example

2009-01-08 Thread Brian Doyle
This works: (filter #(re-find #"\.clj$" (str %)) (file-seq(java.io.File. "."))) On Thu, Jan 8, 2009 at 7:16 PM, wubbie wrote: > > I tried > > (filter #(re-find #"\.clj$" %) (seq (file-seq(java.io.File. "." > -> java.lang.ClassCastException: java.io.File cannot be cast to > java.lang.CharSe

Re: How can I find all files ending with .clj, for example

2009-01-08 Thread wubbie
I tried (filter #(re-find #"\.clj$" %) (seq (file-seq(java.io.File. "." -> java.lang.ClassCastException: java.io.File cannot be cast to java.lang.CharSequence (NO_SOURCE_FILE:0) On Jan 8, 9:06 pm, Achim Passen wrote: > On 9 Jan., 03:03, Achim Passen wrote: > > > (filter #(re-find #".clj$

Re: How can I find all files ending with .clj, for example

2009-01-08 Thread Achim Passen
On 9 Jan., 03:03, Achim Passen wrote: > (filter #(re-find #".clj$" %) … ) correction: (filter #(re-find #"\.clj$" %) … ) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, se

Re: How can I find all files ending with .clj, for example

2009-01-08 Thread Achim Passen
Hi! (filter #(re-find #".clj$" %) … ) see http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/Pattern.html (Boundary matchers) Kind regards, achim On 9 Jan., 02:39, wubbie wrote: > thanks, > > Is there anyway to specify regular expression, instead of startsWith/ > endsWith? > -sun > > On

Re: How can I find all files ending with .clj, for example

2009-01-08 Thread wubbie
thanks, Is there anyway to specify regular expression, instead of startsWith/ endsWith? -sun On Jan 8, 8:00 pm, James Reeves wrote: > On Jan 9, 12:48 am, wubbie wrote: > > > I can use file-seq > > (file-seq (File. ".")) > > But how can I filter out all files ending with .clj? > > Do we use re-

Re: How can I find all files ending with .clj, for example

2009-01-08 Thread James Reeves
On Jan 9, 12:48 am, wubbie wrote: > I can use file-seq > (file-seq (File. ".")) > But how can I filter out all files ending with .clj? > Do we use re-find, re-seq etc? You can just use filter: (filter #(.endsWith (str %) ".clj") (file-seq (File. "."))) - James --~--~-~--~~-

Re: How can I find all files ending with .clj, for example

2009-01-08 Thread Brian Doyle
Here's one of many ways to do this: (filter #(.endsWith (.getName %1) ".clj" ) (file-seq (java.io.File. "."))) On Thu, Jan 8, 2009 at 5:48 PM, wubbie wrote: > > Hi all, > > I can use file-seq > (file-seq (File. ".")) > But how can I filter out all files ending with .clj? > Do we use re-find, r

How can I find all files ending with .clj, for example

2009-01-08 Thread wubbie
Hi all, I can use file-seq (file-seq (File. ".")) But how can I filter out all files ending with .clj? Do we use re-find, re-seq etc? thanks sun --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To p