bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#15912: Improve API of recently-added bool vector functions.


From: Paul Eggert
Subject: bug#15912: Improve API of recently-added bool vector functions.
Date: Sun, 17 Nov 2013 12:17:32 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0

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.)

Attachment: boolvec.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]