Mercurial > emacs
comparison lispref/sequences.texi @ 38789:72006230a5d8
Add bool-vector example.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 12 Aug 2001 21:18:06 +0000 |
parents | 59051c56859f |
children | bf397d008909 |
comparison
equal
deleted
inserted
replaced
38788:0f05936702f1 | 38789:72006230a5d8 |
---|---|
701 @defun bool-vector-p object | 701 @defun bool-vector-p object |
702 This returns @code{t} if @var{object} is a bool-vector, | 702 This returns @code{t} if @var{object} is a bool-vector, |
703 and @code{nil} otherwise. | 703 and @code{nil} otherwise. |
704 @end defun | 704 @end defun |
705 | 705 |
706 Here is an example of creating, examining, and updating a | |
707 bool-vector. Note that the printed form represents up to 8 boolean | |
708 values as a single character. | |
709 | |
710 @example | |
711 (setq bv (make-bool-vector 5 t)) | |
712 @result{} #&5"^_" | |
713 (aref bv 1) | |
714 @result{} t | |
715 (aset bv 3 nil) | |
716 @result{} nil | |
717 bv | |
718 @result{} #&5"^W" | |
719 @end example | |
720 | |
721 @noindent | |
722 These results make sense because the binary codes for control-_ and | |
723 control-W are 11111 and 10111, respectively. | |
724 |