On Thu, Dec 22, 2011 at 5:10 PM, Kevin Downey <redc...@gmail.com> wrote:
> > fns are not free. every (fn* …) in macroexpanded source results in a new > class. > > This is only a problem with respect to load times- clojure tends to make java's already long load times even longer. Actual function call costs are pretty low. Doing a variable dereference is somewhat expensive. That being said, in defense of functions- - You can pass them around, store them in data structures, etc. - You can compose them. - You can rebind variables, allowing you to wrap functions (for tracing, memoization, etc), reload modules in working code, etc. - The JVM has a limit of 64K instructions in a function. I have hit cases where too many macro expansions produced such huge functions. - Many > that being said I tend to take hairier macros and turn them into pairs > of functions that take a thunk and macros that wrap their bodies in a > thunk. > > Why do you care? > > > -- > > 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 > > > > -- > And what is good, Phaedrus, > And what is not good— > Need we ask anyone to tell us these things? > > -- > 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 > -- 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