[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

*To*: Jens Axel Søgaard <jensaxel@xxxxxxxxxxxx>*Subject*: Re: vector compare*From*: Donovan Kolbly <donovan@xxxxxxxxxxx>*Date*: Thu, 9 Jun 2005 17:11:14 -0500 (CDT)*Cc*: srfi-67@xxxxxxxxxxxxxxxxx*Delivered-to*: srfi-67@xxxxxxxxxxxxxxxxx*In-reply-to*: <42A86397.7040806@xxxxxxxxxxxx>*References*: <OF7B1F9CDE.F4ED119E-ONC125701B.0027F89A-C125701B.002840B7@xxxxxxxxxxx> <42A7F6CF.2090106@xxxxxxxxxxx> <42A86397.7040806@xxxxxxxxxxxx>

On Thu, 9 Jun 2005, Jens Axel Søgaard wrote:

Per Bothner wrote:Sebastian Egner wrote:> The default compare for vectors is unusual, and more critically it is > incompatible with the default compare for lists and strings. > The latter are both lexicographic compare. Correct. In this SRFI, vectors are compared first by length and then lexicographically by default.Do you have any examples or use cases or algorithms that are simpler when using this "natural order"? What prior art is there for using this order?As Sebastian argues, there not 1 natural order of vectors, but the ordering in the srfi is /a/ natural order. A concrete example is the sorting of polynomials: x^3 > x^2 + 1 > x^2 > 42 A concrete representation in terms of vectors yields: #(3 0 0 0) > #(2 0 1) > #(2 0 0) > #(42)

(vector-compare x y) is so much different than: (list-compare (vector->list x) (vector->list y)) is just not worth it.

-- Donovan Kolbly ( d.kolbly@xxxxxxxxxxx ( http://www.rscheme.org/~donovan/

**References**:**Re: vector compare***From:*Sebastian Egner

**Re: vector compare***From:*Per Bothner

**Re: vector compare***From:*Jens Axel Søgaard

- Prev by Date:
**Re: vector compare** - Next by Date:
**Re: vector compare** - Previous by thread:
**Re: vector compare** - Next by thread:
**Re: vector compare** - Index(es):