GNU bug report logs -
#15912
Improve API of recently-added bool vector functions.
Previous Next
Reported by: Paul Eggert <eggert <at> cs.ucla.edu>
Date: Sun, 17 Nov 2013 08:40:02 UTC
Severity: minor
Tags: patch
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Daniel Colascione wrote:
> I ... dislike count-leading as a name: it suggests that the function
> is useful only at the beginning of a vector. How about count-consecutive?
Sounds good. Revised patch attached.
> bool-vector-count-matches is supposed to be evocative to CL's
> count-matches, which has a similar interface.
I can't find 'count-matches' in the online documentation for CL, here:
http://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node145.html
It appears that (bool-vector-count-population A) would
correspond to Common Lisp's (count t A), and that
(bool-vector-count-consecutive A B I) would correspond to
Common Lisp's (- (or (position (not B) A :start I) (length A)) I).
If so, Common Lisp's API is so far from the latter primitive
that its names don't seem to provide much guidance.
It might make sense to rename the former primitive's name
to bool-vector-count-t, if you'd prefer that.
(P.S. I don't use CL much, so if I'm missing out on some
commonly-used CL library somewhere, please bear with me.)
[boolvec.diff (text/x-patch, attachment)]
This bug report was last modified 11 years and 240 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.