summaryrefslogtreecommitdiff
path: root/module
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2020-04-12 22:17:22 +0200
committerAndy Wingo <wingo@pobox.com>2020-04-12 22:17:22 +0200
commitcae74359decc1a9d28c7892c7344512178eeac2e (patch)
tree72984b9ae43c5aa79ad285caedbda6f83091cdb2 /module
parent24a34074ef8fd91c111ed9987375f25925f69e26 (diff)
downloadguile-cae74359decc1a9d28c7892c7344512178eeac2e.tar.gz
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.
Diffstat (limited to 'module')
-rw-r--r--module/ice-9/sandbox.scm2
-rw-r--r--module/srfi/srfi-60.scm4
-rw-r--r--module/system/vm/frame.scm4
3 files changed, 5 insertions, 5 deletions
diff --git a/module/ice-9/sandbox.scm b/module/ice-9/sandbox.scm
index 3f9359dab..a9eefbfdd 100644
--- a/module/ice-9/sandbox.scm
+++ b/module/ice-9/sandbox.scm
@@ -1075,7 +1075,7 @@ allocation limit is exceeded, an exception will be thrown to the
(define bitvector-bindings
'(((guile)
- bit-count
+ bitvector-count
bit-count*
bit-extract
bit-position
diff --git a/module/srfi/srfi-60.scm b/module/srfi/srfi-60.scm
index b3ddaada7..9bf0a35ca 100644
--- a/module/srfi/srfi-60.scm
+++ b/module/srfi/srfi-60.scm
@@ -1,6 +1,6 @@
;;; srfi-60.scm --- Integers as Bits
-;; Copyright (C) 2005, 2006, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 2005, 2006, 2010, 2020 Free Software Foundation, Inc.
;;
;; This library is free software; you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public
@@ -26,6 +26,7 @@
log2-binary-factors first-set-bit
bit-set?
copy-bit
+ bit-count
bit-field
copy-bit-field
arithmetic-shift
@@ -34,7 +35,6 @@
integer->list
list->integer
booleans->integer)
- #:replace (bit-count)
#:re-export (logand
logior
logxor
diff --git a/module/system/vm/frame.scm b/module/system/vm/frame.scm
index 47f0e1380..89b6399ae 100644
--- a/module/system/vm/frame.scm
+++ b/module/system/vm/frame.scm
@@ -243,7 +243,7 @@
(out (vector-ref outv n))
(kill (vector-ref killv n))
(gen (vector-ref genv n)))
- (let ((out-count (or changed? (bit-count #t out))))
+ (let ((out-count (or changed? (bitvector-count out))))
(bitvector-fill! in (not (zero? n)))
(let lp ((preds (vector-ref preds n)))
(match preds
@@ -258,7 +258,7 @@
(bitvector-set! out def #t))
gen)
(lp (1+ n) first?
- (or changed? (not (eqv? out-count (bit-count #t out))))))))
+ (or changed? (not (eqv? out-count (bitvector-count out))))))))
((or changed? first?)
(lp 0 #f #f))))