A simple-base-string, a simple-bmp-string or a simple binary vector meaning a vector of element type (unsigned-byte
n)
or (signed-byte
n)
for n = 8, 16, 32. In 64-bit LispWorks, n = 64 is also supported.
A non-negative integer.
An integer.
A base-char
.
The functions octet-ref
and load an octet (8-bits element) from the simple vector vector at offset octet-index, and return it as an integer or base-char
.
vector must be either a string with element type base-char
or bmp-char or a binary vector (as defined above). vector cannot be displaced, adjustable or have a fill pointer, and it cannot be a string with element type character
.
octet-index must be an integer, which is used as the count of octets (rather than array elements) to compute the actual offsets.
octet-ref
, base-char-ref
and their setters are intended to allow efficient access to (unsigned-byte 8)
vectors and simple-base-string in the same code. For these types of vector they match what aref
and (setf aref)
do except that they always take and return the same value/result type, while aref
and (setf aref)
take and return a value of a type which depends on the type of the vector. octet-ref
(and base-char-ref) are also more efficient than aref
.
octet-ref
, base-char-ref
and their setters also work on simple binary vectors with element length other than 8 bits, and the results are consistent between themselves. However their results for such vectors do not match aref
, because they will load and set either part of an element or multiple elements. Also the results of octet-ref
(and base-char-ref) and the result of aref
can differ between different platforms due to endianness.
octet-ref
, base-char-ref
and their setters cannot be used on a simple-text-string.
LispWorks User Guide and Reference Manual - 13 Feb 2015