mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-21 11:10:21 +02:00
Replace bit-count with bitvector-count
The old name was wonky and had bad argument order. * NEWS: Add entry. * doc/ref/api-data.texi (Bit Vectors): Update. * libguile/bitvectors.h: * libguile/bitvectors.c (VALIDATE_BITVECTOR): New helper. (scm_bitvector_count): New function. * libguile/deprecated.h: * libguile/deprecated.c (scm_bit_count): Deprecate. * module/ice-9/sandbox.scm (bitvector-bindings): Replace bit-count with bitvector-count. * module/srfi/srfi-60.scm: No need to #:replace bit-count. * module/system/vm/frame.scm (available-bindings): Use bitvector-count. * test-suite/tests/bitvectors.test ("bitvector-count"): Add test.
This commit is contained in:
parent
24a34074ef
commit
cae74359de
10 changed files with 88 additions and 49 deletions
|
@ -6613,13 +6613,12 @@ Return a new list initialized with the elements
|
|||
of the bitvector @var{vec}.
|
||||
@end deffn
|
||||
|
||||
@deffn {Scheme Procedure} bit-count bool bitvector
|
||||
@deffnx {C Function} scm_bit_count (bool, bitvector)
|
||||
Return a count of how many entries in @var{bitvector} are equal to
|
||||
@var{bool}. For example,
|
||||
@deffn {Scheme Procedure} bitvector-count bitvector
|
||||
@deffnx {C Function} scm_bitvector_count (bitvector)
|
||||
Return a count of how many entries in @var{bitvector} are set.
|
||||
|
||||
@example
|
||||
(bit-count #f #*000111000) @result{} 6
|
||||
(bitvector-count #*000111000) @result{} 3
|
||||
@end example
|
||||
@end deffn
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue