summaryrefslogtreecommitdiff
path: root/lispref
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2001-08-12 21:18:06 +0000
committerRichard M. Stallman <rms@gnu.org>2001-08-12 21:18:06 +0000
commit5785f550ab79aa26746a8cce2f23fc6c6d611d97 (patch)
treea48dc0ff4487970587ec853f5c115e0fe3f8a5fe /lispref
parent3ae8380be4a0c04321e6b9fdc656c1e41bdcffc3 (diff)
downloademacs-5785f550ab79aa26746a8cce2f23fc6c6d611d97.tar.gz
Add bool-vector example.
Diffstat (limited to 'lispref')
-rw-r--r--lispref/sequences.texi19
1 files changed, 19 insertions, 0 deletions
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.
+