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


8.5.14 Validating bytevector and related arguments

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

Validation Clause: bytevector obj

Succeed if obj is a bytevector.

Validation Clause: bytevector/false obj

Succeed if obj is #f or a bytevector.

Validation Clause: non-empty-bytevector obj

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

Validation Clause: non-empty-bytevector/false obj

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

Validation Clause: list-of-bytevectors obj

Succeed if obj is null or a list of bytevectors.

Validation Clause: index-for-bytevector bv idx

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

Validation Clause: bytevector-length len

Succeed if len is a non–negative fixnum usable as bytevector length.

Validation Clause: index-and-count-for-bytevector bv idx count

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

In other words: idx and count select a subbytevector of bv.

Validation Clause: start-and-end-for-bytevector bv start end

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

In other words: start and end select a subbytevector of bv by specifying inclusive limits.

Validation Clause: start-and-past-for-bytevector bv start past

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

0 <= start <= (bytevector-length bv)
start <= past <= (bytevector-length bv)

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


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