Re: turn a seq into a list

2009-07-16 Thread Laurent PETIT
But in this particular case (calling (apply list seq)) since we want to create a data structure that will hold the whole seq at once, then apply will not prevent seq from being of a great length, it's the memory heap that will. (I think the question was more : does apply have some "hard coded" lim

Re: turn a seq into a list

2009-07-16 Thread Drew Raines
jvt wrote: > Doesn't apply have a limit on the length of the arguments passed, > too? Yes. http://groups.google.com/group/clojure/msg/34b9a170d36c5ab5 -Drew --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojur

Re: turn a seq into a list

2009-07-16 Thread Meikel Brandmeyer
Hi, On Jul 16, 1:43 pm, jvt wrote: > Doesn't apply have a limit on the length of the arguments passed, too? apply is lazy. user=> (defn foo [& args] (take 5 args)) #'user/foo user=> (apply foo (iterate inc 0)) (0 1 2 3 4) Sincerely Meikel --~--~-~--~~~---~--~~

Re: turn a seq into a list

2009-07-16 Thread jvt
Doesn't apply have a limit on the length of the arguments passed, too? On Jul 16, 7:22 am, Jan Rychter wrote: > Jarkko Oranen writes: > > On Jul 15, 1:54 pm, Jan Rychter wrote: > >> I've been looking for a function that would take a seq and create a list > >> (a real clojure.lang.PersistentLis

Re: turn a seq into a list

2009-07-16 Thread Jan Rychter
Jarkko Oranen writes: > On Jul 15, 1:54 pm, Jan Rychter wrote: >> I've been looking for a function that would take a seq and create a list >> (a real clojure.lang.PersistentList), but haven't found one. The closest >> I got was: >> >> (apply list my-seq) >> >> Essentially, I'm looking for someth

Re: turn a seq into a list

2009-07-15 Thread Meikel Brandmeyer
Hi, On Jul 15, 1:41 pm, Jarkko Oranen wrote: > Essentially, I'm looking for something similar to (vec) that returns > lists. There is also list*. But that returns Cons's not a PersistentList's. Cons is not Counted... Sincerely Meikel --~--~-~--~~~---~--~~ You

Re: turn a seq into a list

2009-07-15 Thread Jarkko Oranen
On Jul 15, 1:54 pm, Jan Rychter wrote: > I've been looking for a function that would take a seq and create a list > (a real clojure.lang.PersistentList), but haven't found one. The closest > I got was: > > (apply list my-seq) > > Essentially, I'm looking for something similar to (vec) that return

turn a seq into a list

2009-07-15 Thread Jan Rychter
I've been looking for a function that would take a seq and create a list (a real clojure.lang.PersistentList), but haven't found one. The closest I got was: (apply list my-seq) Essentially, I'm looking for something similar to (vec) that returns lists. --J. --~--~-~--~~