bytevector-fill! - fill a bytevector with a value
(import (rnrs)) ;R6RS
(import (rnrs bytevectors)) ;R6RS
(bytevector-fill! bytevector fill)
This procedure stores
in every element of
value is an exact integer in the interval [-128, 255]. Negative fill
values are interpreted as bytes, viz.:
(bytevector-fill! bytevector (bitwise-and fill #xff))
Returns unspecified values.
(let ((a (u8-list->bytevector '(1 2 3))))
(bytevector-fill! a 0)
=> #vu8(0 0 0)
This procedure is sometimes useful to clear sensitive parts of memory,
like bytevectors holding cryptographic keys. This is optimistic but is
not in any way guaranteed to wipe the data from memory.
A bytevector that contains the specified value would normally be
created from scratch with
The only difference in behavior between implementations should be in
how fast it runs. This procedure is not present in R7RS-small.
This procedure can raise exceptions with the following condition types:
- &assertion (R6RS)
The wrong number of arguments was passed or an argument was outside its domain.
This page is part of the
It includes materials from the RnRS documents.
More information can be found at
Markup created by unroff 1.0sc, March 04, 2023.