]> gitweb.factorcode.org Git - factor.git/commitdiff
sequences: rename count to count-by
authorDoug Coleman <doug.coleman@gmail.com>
Mon, 15 Aug 2022 02:01:38 +0000 (21:01 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Sun, 26 Feb 2023 23:11:03 +0000 (17:11 -0600)
basis/bit-arrays/bit-arrays-tests.factor
basis/bloom-filters/bloom-filters-tests.factor
basis/compiler/cfg/branch-splitting/branch-splitting.factor
basis/compiler/cfg/builder/alien/boxing/boxing.factor
basis/cpu/x86/64/unix/unix.factor
basis/formatting/formatting.factor
basis/io/sockets/secure/openssl/openssl.factor
basis/math/vectors/vectors.factor
core/sequences/sequences.factor

index b8ec3f7811317a91e57d757e93d6e4b66ae613f4..c10eba47504c2536b6bb59cef7a91b7abf8fc771 100644 (file)
@@ -78,7 +78,7 @@ sequences.private tools.test ;
     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
 
index 205c5e116a3cdd00d57a54cc6f47142132ba28f3..decefe17fa037660784be69a8d2638e1916a3aaa 100644 (file)
@@ -70,7 +70,7 @@ IN: bloom-filters.tests
 { 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 <=
index 3ed216117c82a96ed2112b1da0659ff1f7fcf9ee..f6047e99256a179ae9751a69d19059104faf7462 100644 (file)
@@ -49,7 +49,7 @@ IN: compiler.cfg.branch-splitting
 
 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&& ;
index 6620308454d813841857c360cab3026af63db01b..228e2759e9b7fa6b2f6579855d52eb2511d79544 100644 (file)
@@ -13,7 +13,7 @@ SYMBOL: struct-return-area
 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* ;
index 1cbe41b4fd8abf0aa059741fe9fb5ce9fabee865..5ab78d1d71233aac8b255aae9af230999d3abaf2 100644 (file)
@@ -55,5 +55,5 @@ M: x86.64 dummy-int-params? f ;
 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 ;
index 7c7498f0af249df49499eaecdeec35cf227cb056..d02c39f197366d3546beef42c992ec6f26be630a 100644 (file)
@@ -149,7 +149,7 @@ text      = (formats|plain-text)*
 ]=]
 
 : 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
index 94b0521f2396ea366246b6261e8fbd643ad96cc3..ef79eb78dba43d62b489e39ea6c93535103bd8f3 100644 (file)
@@ -440,7 +440,7 @@ M: ssl-handle dispose*
     "*." ?head [
         {
             [ tail? ]
-            [ [ [ CHAR: . = ] count ] bi@ - 1 <= ]
+            [ [ [ CHAR: . = ] count-by ] bi@ - 1 <= ]
         } 2&&
     ] [
         =
index 12213627f7f716a533604308d35f609e08320b41..44904755217e2712b5c8b066a6d010bca80591bb 100644 (file)
@@ -171,7 +171,7 @@ GENERIC: vall? ( v -- ? )
 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
index 14461f519ee722040e6440b76f5492137de892ce..ff6c40192be7d84dff1c2059986abe51e25e3605 100644 (file)
@@ -1217,6 +1217,9 @@ M: repetition sum [ elt>> ] [ length>> ] bi * ; 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