From: Richard M. Stallman Date: Sun, 12 Aug 2001 21:18:06 +0000 (+0000) Subject: Add bool-vector example. X-Git-Tag: emacs-pretest-21.0.105~207 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5785f550ab79aa26746a8cce2f23fc6c6d611d97;p=emacs.git Add bool-vector example. --- 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. +