]> gitweb.factorcode.org Git - factor.git/commitdiff
grouping: make the $example, not $unchecked-example.
authorJohn Benediktsson <mrjbq7@gmail.com>
Sat, 15 Aug 2015 04:30:57 +0000 (21:30 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sat, 15 Aug 2015 04:30:57 +0000 (21:30 -0700)
basis/grouping/grouping-docs.factor
basis/grouping/grouping.factor

index 2401db1a1a02532d1302f64f9689b51a30f2ce39..51ce48c5f1797af88b21e396d390ca57e7f840ce 100644 (file)
@@ -17,37 +17,48 @@ ARTICLE: "grouping" "Groups and clumps"
 "The difference can be summarized as the following:"
 { $list
     { "With groups, the subsequences form the original sequence when concatenated:"
-        { $unchecked-example
+        { $example
             "USING: grouping ;"
-            "{ 1 2 3 4 } 2 group ." "{ { 1 2 } { 3 4 } }"
+            "{ 1 2 3 4 } 2 group ."
+            "{ { 1 2 } { 3 4 } }"
         }
-        { $unchecked-example
+        { $example
             "USING: grouping ;"
-            "{ 1 2 3 4 } dup" "2 <groups> concat sequence= ." "t"
+            "{ 1 2 3 4 } dup"
+            "2 <groups> concat sequence= ."
+            "t"
         }
     }
     { "With clumps, collecting the first element of each subsequence but the last one, together with the last subsequence, yields the original sequence:"
-        { $unchecked-example
+        { $example
             "USING: grouping ;"
-            "{ 1 2 3 4 } 2 clump ." "{ { 1 2 } { 2 3 } { 3 4 } }"
+            "{ 1 2 3 4 } 2 clump ."
+            "{ { 1 2 } { 2 3 } { 3 4 } }"
         }
-        { $unchecked-example
+        { $example
             "USING: grouping assocs sequences ;"
-            "{ 1 2 3 4 } dup" "2 <clumps> unclip-last [ keys ] dip append sequence= ." "t"
+            "{ 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:"
-        { $unchecked-example
+        { $example
             "USING: grouping ;"
-            "{ 1 2 3 4 } 2 circular-clump ." "{ { 1 2 } { 2 3 } { 3 4 } { 4 1 } }"
+            "{ 1 2 3 4 } 2 circular-clump ."
+            "{ { 1 2 } { 2 3 } { 3 4 } { 4 1 } }"
         }
-        { $unchecked-example
+        { $example
             "USING: grouping assocs sequences ;"
-            "{ 1 2 3 4 } dup" "2 <circular-clumps> keys sequence= ." "t"
+            "{ 1 2 3 4 } dup"
+            "2 <circular-clumps> keys sequence= ."
+            "t"
         }
-        { $unchecked-example
+        { $example
             "USING: grouping ;"
-            "{ 1 2 3 4 } dup" "2 <circular-clumps> [ second ] { } map-as ." "{ 2 3 4 1 }"
+            "{ 1 2 3 4 }"
+            "2 <circular-clumps> [ second ] { } map-as ."
+            "{ 2 3 4 1 }"
         }
     }
 }
index b8aa266fb9be05efa23b3f1814a0e6040b25d3c0..9cabf56193a23dfc14361a4d95c587137f4ca3d6 100644 (file)
@@ -4,7 +4,7 @@ USING: accessors combinators fry kernel math math.order
 sequences sequences.private ;
 IN: grouping
 
-ERROR: groups-error seq group-size ;
+ERROR: groups-error seq n ;
 
 <PRIVATE