Re: Converting sequence from sort into a list

2014-05-06 Thread Dave Tenny
In my case I was just trying to ensure a list type for a java API, though perhaps the clojure reflection layer would have converted a non list seq to a list to match the call, I don't know. On Mon, May 5, 2014 at 9:01 PM, Sean Corfield wrote: > My question would be: why do you specifically nee

Re: Converting sequence from sort into a list

2014-05-05 Thread Sean Corfield
My question would be: why do you specifically need a list? i.e., why isn't a sequence good enough? Sean On May 3, 2014, at 6:30 AM, Dave Tenny wrote: > After nosing around all I've come up with via clojure mechanisms is to use > (apply list (sort ...)). > It seems to work well enough for lists

Re: Converting sequence from sort into a list

2014-05-03 Thread Dave Tenny
After nosing around all I've come up with via clojure mechanisms is to use (apply list (sort ...)). It seems to work well enough for lists of arbitrary size (subject to usual memory/size limitations of large lists). I also considered some native java abuse such as java.util.Arrays.asList(Enumerati

Re: Converting sequence from sort into a list

2014-05-02 Thread Dave Tenny
Sort returns a seq, but not necessarily something for which list? is true. On Fri, May 2, 2014 at 11:01 AM, Plínio Balduino wrote: > Hi Dave > > Sorry if I didn't get it, but doesn't sort already return a list? > > Could explain? > > Plínio > > > > On Fri, May 2, 2014 at 11:53 AM, Dave Tenny w

Re: Converting sequence from sort into a list

2014-05-02 Thread Gary Trakhman
Ah, scratch that, list* returns a seq as well. On Fri, May 2, 2014 at 11:07 AM, Gary Trakhman wrote: > I believe what he wants is a persistentlist. You could get one from > (apply list) or more succinctly/esoterically (list* ..) > > Sort returns a seq view over the array returned by java.util.A

Re: Converting sequence from sort into a list

2014-05-02 Thread Gary Trakhman
I believe what he wants is a persistentlist. You could get one from (apply list) or more succinctly/esoterically (list* ..) Sort returns a seq view over the array returned by java.util.Array.sort() (defn sort "Returns a sorted sequence of the items in coll. If no comparator is supplied, use

Re: Converting sequence from sort into a list

2014-05-02 Thread Plínio Balduino
Hi Dave Sorry if I didn't get it, but doesn't sort already return a list? Could explain? Plínio On Fri, May 2, 2014 at 11:53 AM, Dave Tenny wrote: > I have a sequence from a call to 'sort'. > I want a list. > > What is the best way to do this? > > (apply list (sort ...))? > > Will it have p

Converting sequence from sort into a list

2014-05-02 Thread Dave Tenny
I have a sequence from a call to 'sort'. I want a list. What is the best way to do this? (apply list (sort ...))? Will it have problems on large sequence inputs? I can't use (into () (sort ...)) since that conjoins and ruins the sort order. -- You received this message because you are subsc