I haven't seen the use of multiple statements in the for comprehension
here, so perhaps it's nice to elaborate that this exists?
(defn filter-file [filename]
(with-open [rdr (io/reader filename)]
(set
(for [line (line-seq rdr)
word (str/split line #"\s+")
:when (<= 4 (count word) 9)]
word))))
I would believe that is one of the more evident ways of writing it. If you
would like duplicates, replace set with doall.
-- JN
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.