Previous: , Up: libutils names   [Index]


7.1.3 Library names comparison

The following functions can be used to sort library names according to the version number:

(list-sort library-name<? '((x y (1 2))
                            (x y (1 3))))
⇒ ((x y (1 2))
    (x y (1 3)))

(list-sort library-name<? '((x y (1 4))
                            (x y (1 2))
                            (x y (2 1))
                            (x y (1 3))))
⇒ ((x y (1 2))
    (x y (1 3))
    (x y (1 4))
    (x y (2 1)))

The following bindings are exported by the library (vicare libraries).

Function: library-name=? sexp1 sexp2

Given two symbolic expressions compliant with the definition of ?library-name according to R6RS: return #t if they have the same list of identifiers and the same version numbers.

Function: library-name<? sexp1 sexp2

Given two symbolic expressions compliant with the definition of ?library-name according to R6RS: return #t if they have the same list of identifiers and the version of sexp1 is less than the version of sexp2.

Function: library-name<=? sexp1 sexp2

Given two symbolic expressions compliant with the definition of ?library-name according to R6RS: return #t if they have the same list of identifiers and the version of sexp1 is less than or equal to the version of sexp2.

Function: library-name-identifiers=? sexp1 sexp2

Given two symbolic expressions compliant with the definition of ?library-name according to R6RS: return #t if they have the same list of identifiers.

Function: library-version=? vrs1 vrs2

Given two lists of version numbers compliant with the definition of ?library-name according to R6RS: return #t if they have the same numbers.

If one of the lists is longer and the elements up to the end of the shortest are equal: the lists are “equal” if the tail of the longest is made of zeros.

Examples:

(1 2 3) == (1 2 3)
(1 2 3) != (1 2 3 4)
(1 2 3) == (1 2 3 0 0 0)
Function: library-version<? vrs1 vrs2

Given two lists of version numbers compliant with the definition of ?library-name according to R6RS: return #t if the version number represented by vrs1 is less than the version number represented by vrs2.

Comparison of digits stops at the first digit for which < or > return true.

If one of the lists is longer and the elements up to the end of the shortest are equal: the lists are “equal” if the tail of the longest is made of zeros.

Examples:

(1 2 3) <  (4 2 3)
(1 2 3) <  (1 4 3)
(1 2 3) <  (1 2 4)
(1 2 3) <  (1 2 3 4)
(1 2 3) !< (1 2 3 0 0 0)
Function: library-version<=? vrs1 vrs2

Given two lists of version numbers compliant with the definition of ?library-name according to R6RS: return #t if the version number represented by vrs1 is less than or equal to the version number represented by vrs2.

Comparison of digits stops at the first digit for which <= returns false.

If one of the lists is longer and the elements up to the end of the shortest are equal: the lists are “equal” if the tail of the longest is made of zeros.

Examples:

(1 2 3) <= (1 2 3)
(1 2 3) <= (4 2 3)
(1 2 3) <= (1 4 3)
(1 2 3) <= (1 2 4)
(1 2 3) <= (1 2 3 4)
(1 2 3 0) <= (1 2 3)

Previous: , Up: libutils names   [Index]