From 5785f550ab79aa26746a8cce2f23fc6c6d611d97 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 12 Aug 2001 21:18:06 +0000 Subject: [PATCH] Add bool-vector example. --- lispref/sequences.texi | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lispref/sequences.texi b/lispref/sequences.texi index 4228a79c576..f6869f1da8c 100644 --- a/lispref/sequences.texi +++ b/lispref/sequences.texi @@ -703,3 +703,22 @@ This returns @code{t} if @var{object} is a bool-vector, and @code{nil} otherwise. @end defun + Here is an example of creating, examining, and updating a +bool-vector. Note that the printed form represents up to 8 boolean +values as a single character. + +@example +(setq bv (make-bool-vector 5 t)) + @result{} #&5"^_" +(aref bv 1) + @result{} t +(aset bv 3 nil) + @result{} nil +bv + @result{} #&5"^W" +@end example + +@noindent +These results make sense because the binary codes for control-_ and +control-W are 11111 and 10111, respectively. + -- 2.39.2