t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t t
} bit-array>integer ] unit-test
-{ 49 } [ 49 <bit-array> dup set-bits [ ] count ] unit-test
+{ 49 } [ 49 <bit-array> dup set-bits [ ] count-by ] unit-test
{ 1 } [ ?{ f t f t } byte-length ] unit-test
{ t } [ 1000 <iota> [ drop most-positive-fixnum random 1000 + ] map
full-bloom-filter
[ bloom-filter-member? ] curry map
- [ ] count
+ [ ] count-by
! TODO: This should be 10, but the false positive rate is currently very
! high. 300 is large enough not to prevent builds from succeeding.
300 <=
UNION: irrelevant ##peek ##replace ##inc ;
-: split-instructions? ( insns -- ? ) [ irrelevant? not ] count 5 <= ;
+: split-instructions? ( insns -- ? ) [ irrelevant? not ] count-by 5 <= ;
: short-tail-block? ( bb -- ? )
{ [ successors>> empty? ] [ instructions>> length 2 = ] } 1&& ;
SYMBOLS: int-reg-reps float-reg-reps ;
: reg-reps ( reps -- int-reps float-reps )
- [ second ] reject [ [ first int-rep? ] count ] [ length over - ] bi ;
+ [ second ] reject [ [ first int-rep? ] count-by ] [ length over - ] bi ;
: record-reg-reps ( reps -- reps )
dup reg-reps [ int-reg-reps +@ ] [ float-reg-reps +@ ] bi* ;
M: x86.64 dummy-fp-params? f ;
M: x86.64 %prepare-var-args
- [ second reg-class-of float-regs? ] count 8 min
+ [ second reg-class-of float-regs? ] count-by 8 min
[ EAX EAX XOR ] [ <byte> AL swap MOV ] if-zero ;
]=]
: printf-quot ( format-string -- format-quot n )
- parse-printf [ [ callable? ] count ] keep [
+ parse-printf [ [ callable? ] count-by ] keep [
dup string? [ 1quotation ] [ [ 1 - ] dip ] if
over [ ndip ] 2curry
] map nip [ compose-all ] [ length ] bi ; inline
"*." ?head [
{
[ tail? ]
- [ [ [ CHAR: . = ] count ] bi@ - 1 <= ]
+ [ [ [ CHAR: . = ] count-by ] bi@ - 1 <= ]
} 2&&
] [
=
M: object vall? [ ] all? ; inline
GENERIC: vcount ( v -- count )
-M: object vcount [ ] count ; inline
+M: object vcount [ ] count-by ; inline
GENERIC: vany? ( v -- ? )
M: object vany? [ ] any? ; inline
: count ( ... seq quot: ( ... elt -- ... ? ) -- ... n )
[ 1 0 ? ] compose map-sum ; inline
+: count-by ( ... seq quot: ( ... elt -- ... ? ) -- ... n )
+ [ 1 0 ? ] compose map-sum ; inline
+
: cartesian-each ( ... seq1 seq2 quot: ( ... elt1 elt2 -- ... ) -- ... )
[ with each ] 2curry each ; inline