Hi,

On 7 Apr., 15:11, Baishampayan Ghose <b.gh...@gmail.com> wrote:

> On a more serious note, how do I find out how many classes a form compiles to?

Each anonymous function you define via fn or #() generates a new
class. Functions like comp or partial just return a new instance of
the anonymous class contained in the comp resp. partial definition. So
they don't create a new class.

(defn apply-fs1
  [fs & args]
  (map (apply comp (reverse fs)) args))

1 new class for the defn, comp just returns a new instance of an
existing class

(defn apply-fs2
  [fs & args]
  (map #(reduce (fn [x f] (f x)) % fs) args))

3 new classes: defn, the #() and the (fn)

In general, you can't tell without knowing the macro expansion,
because the expansion could contain (fn) forms.

Sincerely
Meikel

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to