diff options
| author | Richard M. Stallman | 2001-08-12 21:18:06 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2001-08-12 21:18:06 +0000 |
| commit | 5785f550ab79aa26746a8cce2f23fc6c6d611d97 (patch) | |
| tree | a48dc0ff4487970587ec853f5c115e0fe3f8a5fe | |
| parent | 3ae8380be4a0c04321e6b9fdc656c1e41bdcffc3 (diff) | |
| download | emacs-5785f550ab79aa26746a8cce2f23fc6c6d611d97.tar.gz emacs-5785f550ab79aa26746a8cce2f23fc6c6d611d97.zip | |
Add bool-vector example.
| -rw-r--r-- | lispref/sequences.texi | 19 |
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, | |||
| 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 | |||