chickadee » srfi-4 » #s8

#u8read
#u16read
#u32read
#s8read
#s16read
#s32read
#f32read
#f64read

The external representation of instances of the datatype XXXvector is #XXX( ...elements... ).

For example,

#u8(0 #e1e2 #xff)  ; a u8vector of length 3 containing 0, 100, 255
#f64(-1.5)         ; a f64vector of length 1 containing -1.5.

This external representation is also available in program source code. For example,

(set! x '#u8(1 2 3))

will set x to the object #u8(1 2 3). Since CHICKEN 4.9.0, literal homogeneous vectors do not have to be quoted. Homogeneous vectors can appear in quasiquotations but must not contain unquote or unquote-splicing forms. I.e.,

`(,x #u8(1 2))        ; legal
`#u8(1 ,x 2)          ; illegal

Elements may also be characters or strings, in that case they are interpreted as a sequence of numerical character codes. For example,

'#u8(#\x7f "EL" #\F 2 1)

is equivalent to

'#u8(#\x7f #\x45 #\x4c #\x46 2 1)

Character literals inside numeric vectors expand into the UTF-8 sequence of the characters they represent, for strings the contained characters are interpreted in whatever encoding is used for the text file or stream in which the literal appears.

Note that #u8"..." can be used as an abbreviation for the special case #u8("...").