Next: , Up: libutils refs   [Index]


7.2.1 Library reference predicates

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

Function: library-reference? obj

Return #t if obj is a valid library reference as specified by R6RS.

(library-reference? '())                        ⇒ #f
(library-reference? '(alpha))                   ⇒ #t
(library-reference? '(alpha beta gamma))        ⇒ #t
(library-reference? '(alpha beta gamma ()))     ⇒ #t
(library-reference? '(alpha beta gamma (1)))    ⇒ #t
(library-reference?
    '(alpha beta (1
                  (<= 2)
                  (or 10 (and (>= 4)
                              (<= 2))))))
⇒ #t
Function: library-version-reference? obj

Return #t if obj is a valid library version reference as specified by R6RS.

(library-version-reference? '())                ⇒ #t
(library-version-reference? '(1))               ⇒ #t
(library-version-reference? '(1 2 3))           ⇒ #t

(library-version-reference? '(and))             ⇒ #t
(library-version-reference? '(and (1)))         ⇒ #t
(library-version-reference? '(and (1) (2)))     ⇒ #t

(library-version-reference? '(or))              ⇒ #t
(library-version-reference? '(or (1)))          ⇒ #t
(library-version-reference? '(or (1) (2)))      ⇒ #t

(library-version-reference? '(not))             ⇒ #f
(library-version-reference? '(not (1)))         ⇒ #t

(library-version-reference?
   '(1
     (<= 2)
     (or 10
         (and (<= 4)
              (>= 2)))))
⇒ #t
Function: library-sub-version-reference? obj

Return #t if obj is a valid library sub–version reference as specified by R6RS.

Function: library-sub-version? obj

Return #t if obj is a ?sub-version number according to R6RS.

NOTE According to R6RS: obj should be an exact non–negative integer, which means a non–negative finxum or bignum. Vicare accepts only fixnums because they are faster to handle and “big enough”.