Next: , Previous: , Up: args predefined   [Index]


8.5.13 Validating vector and related arguments

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

Validation Clause: vector obj

Succeed if obj is a vector.

Validation Clause: vector/false obj

Succeed if obj is #f or a vector.

Validation Clause: non-empty-vector obj

Succeed if obj is a vector and its length is greater than zero.

Validation Clause: non-empty-vector/false obj

Succeed if obj is #f or a vector and its length is greater than zero.

Validation Clause: index-for-vector vec idx

Succeed if idx is a fixnum usable as index (not out of range) for vec, which is expected to be an already validated vector.

Validation Clause: index-and-count-for-vector vec idx count

Assuming that vec is an already validated vector: succeed if idx is a fixnum usable as index (not out of range) for vec, and count is a fixnum which can be used as characters count in vec starting and idx without going out of range.

In other words: idx and count select a subvector of vec.

Validation Clause: start-and-end-for-vector vec start end

Assuming that vec is an already validated vector: succeed if both start and end are fixnums usable as indexes (not out of range) for vec, and start is less than or equal to end.

In other words: start and end select a subvector of vec by specifying inclusive limits.

Validation Clause: start-and-past-for-vector vec start past

Assuming that vec is an already validated vector: succeed if both start and past are fixnums satisfying the constraints:

0 <= start <= (vector-length vec)
start <= past <= (vector-length vec)

In other words: start and past select a subvector of vec by specifying left–inclusive and right–exclusive limits.


Next: , Previous: , Up: args predefined   [Index]