Re: split maps contained in a file

2014-03-27 Thread Mauricio Aldazosa
Slurp returns one big string, in this case (assuming you have one map for each line) you can use line-seq: user> (with-open [rdr (clojure.java.io/reader "file-with-maps")] (doall (map read-string (line-seq rdr ({:a 1, :b 2} {:c 3, :d 4}) Cheers, Mauricio -- You received th

Re: Newbie Question on re-split

2009-06-24 Thread Teemu Antti-Poika
On Jun 24, 4:36 am, John Carnell wrote: > (defn split-by-whitespace [sentence]( >    (re-split #"\W+" sentence) >    )) > Try removing the extra parenthesis: (defn split-by-whitespace [sentence] (re-split #"\W+" sentence)) Teemu --~--~-~--~~-

Newbie Question on re-split

2009-06-24 Thread John Carnell
Hi guys, I am stuck and I am hoping someone can help me with this as I have been stuck. I am working in the REPL and when I call the re-split function user=> (re-split #"\W+" "This is simple sentence") I get the results properly. However, if I try to wrap the same

Re: re-split

2008-09-12 Thread Chouser
On Fri, Sep 12, 2008 at 1:07 PM, Stuart Sierra <[EMAIL PROTECTED]> wrote: > > Hi Chris, just noticed this post. I wanted re-split to behave like > Perl/Ruby's split, although the dot-method syntax makes it redundant > with (.split string "regex"). > > Strin

Re: re-split

2008-09-12 Thread Stuart Sierra
Hi Chris, just noticed this post. I wanted re-split to behave like Perl/Ruby's split, although the dot-method syntax makes it redundant with (.split string "regex"). String.split(...) takes a String argument as the regex, not a Pattern; not sure if there's a performance pena

re-split

2008-09-08 Thread Chouser
I'd written a re-split before discovering Stuart's in clojure.contrib.str-utils. Mine's a little different in that it's lazy and the seq it returns includes the parts that match the pattern as well as the parts in between: user=> (my-re-split #"[0-9]+" "