This sounds like a neat idea to me. Maybe the way to get the
'complexity' is to calculate it at definition, this macro doesn't work
for obvious reasons:
(defmacro defnc
[n & body]
`(let [f# (defn ~n ~...@body)]
(alter-meta! (var ~n) assoc :complexity (count-nodes ~body))
f#))
But I think something similar could do the trick?
On Oct 26, 2:56 pm, MarkSwanson <[email protected]> wrote:
> Do you (or anyone) believe some general guidelines could be gathered
> from running count-nodes against all of the individual fns in a
> project. F.E. a number > X(?) for a fn means you might be using an
> imperative style and should be looking at breaking up the fn or
> looking for ways to use map/reduce/other idiomatic Clojure fns to
> simplify your code?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---