> Let me know what you all think!
In this case, A. I've definitely been known to use composition, but
only when the definition is simple and expressive: e.g.,
(def clean-lines (comp non-empty trimmed-lines read-lines))
I find this much nicer than stacking parens:
(defn clean-lines [x]
(non-empty
(trimmed-lines
(read-lines x)))
though I've never compared efficiency, and I know it makes it harder
to add docstrings.
This is the difference between 'conventional' and point-free style, by
the way. Many people view point-free as being somehow more elegant,
and I'm generally inclined to agree... apart from in cases like your
example, where a ton of partials need to be added.
-R
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---