I'm building an ETL app, so aggregate functions of arbitrarily large
arity is a necessity.  I've had to wrap a lot of core clojure
functions with concrete arg lists to make them work with lazy
sequences.  In my limited experience, machine generated code of this
nature should use lazy sequences that get realized at eval-time rather
with arg lists that are realized compile-time.

Keep in mind that currently, functions are subclasses of AFunction
where constants are stored in the class file as static final class
members.  This may eventually get optimized, but I wouldn't hold my
breath; it would take a LOT of static analysis to recognize closures,
and this level of support for macros will probably never happen.  Each
function eats up your permgen.  Garbage collection of classes vs.
objects is also REALLY tricky.  So you're probably better off using
sequences that consume plain old heap and functions that don't close
over things so you use less permgen space.

So yes, I don't think this is worth getting worked up about.

On Nov 14, 9:13 pm, David Nolen <dnolen.li...@gmail.com> wrote:
> On Sun, Nov 14, 2010 at 4:21 PM, Robert McIntyre <r...@mit.edu> wrote:
> > That is not in fact an adequate workaround ---
>
> > (eval `(apply + ~@(take 9001 (iterate inc 1))))  ;; OVER 9000!!!
>
> > or, alternately
>
> > (eval (cons 'apply (cons '+ (take 9001 (iterate inc 1)))))
>
> > will fail just as in the addition examples.
>
> > It's not true that you can just use an apply in your auto generated
> > code, you would instead have to do something like a tree of function
> > calls, so It may be worth increasing the limit for for the sake of
> > enabling machine generated code.
>
> > What are you peoples' thoughts on this?
>
> > --Robert McIntyre
>
> Not worth getting worked up.
>
> David- Hide quoted text -
>
> - Show quoted text -

-- 
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