]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/grouping/grouping-docs.factor
Use keys/values where appropriate
[factor.git] / basis / grouping / grouping-docs.factor
index 0c9db38f4bc8d29009d94fe08519af04d8736eb6..c91eb231ab6fee5f5d4e3235501ea3791e9bef8e 100644 (file)
@@ -32,8 +32,8 @@ ARTICLE: "grouping" "Groups and clumps"
             "{ 1 2 3 4 } 2 clump ." "{ { 1 2 } { 2 3 } { 3 4 } }"
         }
         { $unchecked-example
-            "USING: grouping ;"
-            "{ 1 2 3 4 } dup" "2 <clumps> unclip-last [ [ first ] map ] dip append sequence= ." "t"
+            "USING: grouping assocs sequences ;"
+            "{ 1 2 3 4 } dup" "2 <clumps> unclip-last [ keys ] dip append sequence= ." "t"
         }
     }
     { "With circular clumps, collecting the first element of each subsequence yields the original sequence. Collecting the " { $snippet "n" } "th element of each subsequence would rotate the original sequence " { $snippet "n" } " elements rightward:"
@@ -42,8 +42,8 @@ ARTICLE: "grouping" "Groups and clumps"
             "{ 1 2 3 4 } 2 circular-clump ." "{ { 1 2 } { 2 3 } { 3 4 } { 4 1 } }"
         }
         { $unchecked-example
-            "USING: grouping ;"
-            "{ 1 2 3 4 } dup" "2 <circular-clumps> [ first ] map sequence= ." "t"
+            "USING: grouping assocs sequences ;"
+            "{ 1 2 3 4 } dup" "2 <circular-clumps> keys sequence= ." "t"
         }
         { $unchecked-example
             "USING: grouping ;"