[racket-dev] Feature request: Vector-sort

From: Pierpaolo Bernardi (olopierpa at gmail.com)
Date: Sun Jul 29 18:26:22 EDT 2012

Also:

(require data/heap)

heap-sort!



2012/7/30, Eli Barzilay <eli at barzilay.org>:
> A few minutes ago, Harry Spier wrote:
>> I would find a sort function for vectors very useful.
>
> Actually, the `sort' code uses a vector to do its work, which is
> initialized from the input list.  But it doesn't help much to make it
> deal with vectors too, since the vector that is used for the sorting
> work needs to be bigger than the input -- so to sort a vector you'd
> still need to create a copy.  Given that, you can usually just do the
> usual (list->vector (sort (vector->list v) <)).
>
> --
>           ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
>                     http://barzilay.org/                   Maze is Life!
> _________________________
>   Racket Developers list:
>   http://lists.racket-lang.org/dev
>

-- 
Inviato dal mio dispositivo mobile

Posted on the dev mailing list.