]> gitweb.factorcode.org Git - factor.git/commitdiff
Docs: example for head? and subwords
authorBjörn Lindqvist <bjourne@gmail.com>
Mon, 18 Nov 2013 16:13:51 +0000 (17:13 +0100)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 14 Apr 2014 15:42:09 +0000 (08:42 -0700)
core/sequences/sequences-docs.factor
core/words/words-docs.factor

index ad0d557637462b0774e347760cc43f66845676e0..60db385cac71cfd1afc91c367beedd5258dc2d98 100644 (file)
@@ -945,7 +945,13 @@ HELP: shorter?
 
 HELP: head?
 { $values { "seq" sequence } { "begin" sequence } { "?" "a boolean" } }
-{ $description "Tests if " { $snippet "seq" } " starts with " { $snippet "begin" } ". If " { $snippet "begin" } " is longer than " { $snippet "seq" } ", this word outputs " { $link f } "." } ;
+{ $description "Tests if " { $snippet "seq" } " starts with " { $snippet "begin" } ". If " { $snippet "begin" } " is longer than " { $snippet "seq" } ", this word outputs " { $link f } "." }
+{ $examples
+  { $example
+    "root-cache get keys [ \"help.l\" head? ] filter ."
+    "{ \"help.lint.checks\" \"help.lint.private\" \"help.lint\" }"
+  }
+} ;
 
 HELP: tail?
 { $values { "seq" sequence } { "end" sequence } { "?" "a boolean" } }
index 72320d23b6a226ede8057da1ba1cad58d0939256..4d08312cc71d98a12f9ffc76a5efa581d3d9372d 100644 (file)
@@ -346,6 +346,18 @@ HELP: deprecated?
 { $description "Tests if an object is " { $link POSTPONE: deprecated } "." }
 { $notes "Outputs " { $link f } " if the object is not a word." } ;
 
+HELP: subwords
+{ $values { "word" word } }
+{ $description "Lists all specializations for the given word." }
+{ $examples
+  { $example
+    "USING: math.functions ;"
+    "clear \ sin subwords ."
+    "{ M\ object sin M\ complex sin M\ real sin M\ float sin }"
+  }
+}
+{ $notes "Outputs " { $link f } " if the word isn't generic." } ;
+
 HELP: make-deprecated
 { $values { "word" word } }
 { $description "Declares a word as " { $link POSTPONE: deprecated } "." }