On Jan 28, 4:14 am, ivant <itosh...@gmail.com> wrote:
> On Jan 26, 1:31 am, "Stephen C. Gilardi" <squee...@mac.com> wrote:
>
> > The usual way to do this is with "(apply str ...)"
>
> I just wonder if there is a limit to how long the sequence can be,
> because apply should use the Java calling stack, right?

Coming from CL I was surprised by this, but as far as I understand,
there is no such limit.  Apply can work even with infinite seqs of
arguments!

user> (apply distinct? (interleave (iterate inc 0) (iterate inc 10)))
false

As far as I can tell, the trick is that when you use "&" in your fn
arglist, the remaining arguments are bound to it as a lazy seq.  On
each call, only as many arguments as you explicitly declare are
actually evaluated.

-Jason


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