[REBOL] Re: sort/compare

2003-12-10 Thread Anton Rolls
Hi Ladislav, I am not going to change my sort now, because I would need to customize it again, but mergesort would be a good reference to have in the library at any rate. Shellsort performance is pretty good, anyway. Anton. > Anton Rolls napsal(a): > > >In any case, I have implemented a custo

[REBOL] Re: sort/compare

2003-12-10 Thread Ladislav Mecir
Anton Rolls napsal(a): >In any case, I have implemented a customized shell-sort >for the job, working fine so far. > >Regards, > > I have got a Merge Sort implementation for quite a long time (from 1.x days). It works fast (no exceptional cases), uses only one "additional" block and it is sta

[REBOL] Re: sort/compare

2003-12-09 Thread Anton Rolls
Tom, Thankyou, however I should have mentioned that I don't have control over the block being sorted, so I can't just add indices to it. I'm implementing yet another list style, and the block belongs to the user of of the list - therefore I shouldn't change it by adding indices, you see. Copy is

[REBOL] Re: sort/compare

2003-12-08 Thread Tom Conlin
Hi Anton, > Just wondering if there is a way to find > the indices of the pair of values passed > to the compare function (directly, without using find). > > Here's a simple use of sort/compare: > > sort/compare a: [1 4 9 7 3 2] func [v1 v2][v2 < v1] > > Now here you can see how many compa

[REBOL] Re: sort compare function with refinement?

2001-02-26 Thread Ladislav Mecir
The only solution I can suggest is: sort/compare book-db func [x y] [compare-book/title x y] Regards Ladislav > > Hi, > > I try to sort a block of objects using a compare function with refinements to > select the member of the object I want to sort after. But I always get an > error if I us