]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/generalizations/generalizations-docs.factor
Move firstn to generalizations, clean it up a bit
[factor.git] / extra / generalizations / generalizations-docs.factor
index d2af13a9c3393bc43bf7cd880a62bdc39a4aa8e9..a702f452da6d8764c29d8f499e66b83336b65829 100755 (executable)
@@ -1,9 +1,21 @@
-! Copyright (C) 2007 Chris Double.\r
-! See http://factorcode.org/license.txt for BSD license.\r
 USING: help.syntax help.markup kernel sequences quotations\r
-math ;\r
+math arrays ;\r
 IN: generalizations\r
 \r
+HELP: narray\r
+{ $values { "n" integer } }\r
+{ $description "A generalization of " { $link 1array } ", "\r
+{ $link 2array } ", " { $link 3array } " and " { $link 4array } " "\r
+"that constructs an array from the top " { $snippet "n" } " elements of the stack."\r
+} ;\r
+\r
+HELP: firstn\r
+{ $values { "n" integer } }\r
+{ $description "A generalization of " { $link first } ", "\r
+{ $link first2 } ", " { $link first3 } " and " { $link first4 } " "\r
+"that pushes the first " { $snippet "n" } " elements of a sequence on the stack."\r
+} ;\r
+\r
 HELP: npick\r
 { $values { "n" integer } }\r
 { $description "A generalization of " { $link dup } ", "\r
@@ -119,6 +131,7 @@ ARTICLE: "generalizations" "Generalized shuffle words and combinators"
 "macros where the arity of the input quotations depends on an "\r
 "input parameter."\r
 { $subsection narray }\r
+{ $subsection firstn }\r
 { $subsection ndup }\r
 { $subsection npick }\r
 { $subsection nrot }\r