]> gitweb.factorcode.org Git - factor.git/commitdiff
sequences.generalizations: adding docs to ?firstn.
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 18 Nov 2020 19:09:17 +0000 (11:09 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 18 Nov 2020 19:09:17 +0000 (11:09 -0800)
basis/sequences/generalizations/generalizations-docs.factor

index 0f012e621f97184f93b666ca8c139c0e25b57fbb..b82a8a9a9b6bebe2ddb0c4f9ea96fb31fd1554b1 100644 (file)
@@ -50,7 +50,13 @@ HELP: firstn
 
 HELP: ?firstn
 { $values { "n" integer } }
-{ $description "A generalization of " { $link ?first } " that pushes the first " { $snippet "n" } " elements of a sequence on the stack, or " { $link f }  " if the sequence is shorter than the requested number of elements." } ;
+{ $description "A generalization of " { $link ?first } " that pushes the first " { $snippet "n" } " elements of a sequence on the stack, or " { $link f }  " if the sequence is shorter than the requested number of elements." }
+{ $examples
+    "Some core words expressed in terms of " { $link ?firstn } ":"
+    { $table
+        { { $link ?first } { $snippet "1 ?firstn" } }
+    }
+} ;
 
 HELP: set-firstn
 { $values { "n" integer } }