aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorDmitry Antipov2014-05-19 11:49:09 +0400
committerDmitry Antipov2014-05-19 11:49:09 +0400
commit2bcf0551dff645b8c691290adf58dc890b79e745 (patch)
tree3962d715c1f4d8e83e6d874cb7936b01e573a3b9 /doc
parent60fc70a8e0bf25d7388fb4c2e31d912c203f561d (diff)
downloademacs-2bcf0551dff645b8c691290adf58dc890b79e745.tar.gz
emacs-2bcf0551dff645b8c691290adf58dc890b79e745.zip
* src/lisp.h (CHECK_BOOLEAN): New function.
* src/alloc.c (Fbool_vector): New function. (syms_of_alloc): Defsubr it. * src/data.c (Qbooleanp): New symbol. (syms_of_data): DEFSYM it. * src/dbusbind.c (xd_signature): Use CHECK_BOOLEAN. * doc/lispref/sequences.texi (Bool-vectors): Mention bool-vector.
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/ChangeLog4
-rw-r--r--doc/lispref/sequences.texi33
2 files changed, 33 insertions, 4 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index d892e1307a0..9614b89f66e 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,7 @@
12014-05-19 Dmitry Antipov <dmantipov@yandex.ru>
2
3 * sequences.texi (Bool-vectors): Mention bool-vector.
4
12014-05-17 Paul Eggert <eggert@cs.ucla.edu> 52014-05-17 Paul Eggert <eggert@cs.ucla.edu>
2 6
3 Assume C99 or later (Bug#17487). 7 Assume C99 or later (Bug#17487).
diff --git a/doc/lispref/sequences.texi b/doc/lispref/sequences.texi
index da53990b449..1f7cd435cf6 100644
--- a/doc/lispref/sequences.texi
+++ b/doc/lispref/sequences.texi
@@ -811,7 +811,7 @@ value into an element of the bool-vector, the effect is to store
811and the length cannot be changed once the bool-vector is created. 811and the length cannot be changed once the bool-vector is created.
812Bool-vectors are constants when evaluated. 812Bool-vectors are constants when evaluated.
813 813
814 There are two special functions for working with bool-vectors; aside 814 There are three special functions for working with bool-vectors; aside
815from that, you manipulate them with same functions used for other kinds 815from that, you manipulate them with same functions used for other kinds
816of arrays. 816of arrays.
817 817
@@ -820,6 +820,32 @@ Return a new bool-vector of @var{length} elements,
820each one initialized to @var{initial}. 820each one initialized to @var{initial}.
821@end defun 821@end defun
822 822
823@defun bool-vector &rest objects
824This function creates and returns a bool-vector whose elements are the
825arguments, @var{objects}, each of them should be either @code{t} or @code{nil}.
826Note that the printed form represents up to 8 boolean values as a single
827character:
828
829@example
830@group
831(bool-vector t nil t nil)
832 @result{} #&4"^E"
833(bool-vector)
834 @result{} #&0""
835@end group
836@end example
837
838If you want to print a bool-vector in a way similar to other vectors,
839you can use @code{vconcat} function:
840
841@example
842@group
843(vconcat (bool-vector nil t nil t))
844 @result{} [nil t nil t]
845@end group
846@end example
847@end defun
848
823@defun bool-vector-p object 849@defun bool-vector-p object
824This returns @code{t} if @var{object} is a bool-vector, 850This returns @code{t} if @var{object} is a bool-vector,
825and @code{nil} otherwise. 851and @code{nil} otherwise.
@@ -873,9 +899,8 @@ or @code{nil}, and @var{i} is an index into @code{a}.
873Return the number of elements that are @code{t} in bool vector @var{a}. 899Return the number of elements that are @code{t} in bool vector @var{a}.
874@end defun 900@end defun
875 901
876 Here is an example of creating, examining, and updating a 902 Here is another example of creating, examining, and updating a
877bool-vector. Note that the printed form represents up to 8 boolean 903bool-vector:
878values as a single character.
879 904
880@example 905@example
881(setq bv (make-bool-vector 5 t)) 906(setq bv (make-bool-vector 5 t))