[racket-dev] Feature request: Vector-sort

From: Eli Barzilay (eli at barzilay.org)
Date: Sun Jul 29 18:12:04 EDT 2012

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!

Posted on the dev mailing list.