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
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
--~--~-~--~~-
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
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
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
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]+" "