]> gitweb.factorcode.org Git - factor.git/commitdiff
kernel: adding docs for "same?"
authorJohn Benediktsson <mrjbq7@gmail.com>
Sun, 22 Jul 2012 02:43:16 +0000 (19:43 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sun, 22 Jul 2012 02:43:16 +0000 (19:43 -0700)
core/kernel/kernel-docs.factor

index 9198fc5cd0bd92bb82bcf2132e3f898c8870ce52..1a536bae85e842e99b6cdaad052e6e84013963aa 100644 (file)
@@ -184,6 +184,14 @@ HELP: either?
     { $example "USING: kernel math prettyprint ;" "5 7 [ even? ] either? ." "f" }
 } ;
 
+HELP: same?
+{ $values { "x" object } { "y" object } { "quot" { $quotation "( ... obj -- ... obj' )" } } { "?" "a boolean" } }
+{ $description "Applies the quotation to both " { $snippet "x" } " and " { $snippet "y" } ", and then checks if the results are equal." }
+{ $examples
+    { $example "USING: kernel math prettyprint ;" "4 5 [ 2/ ] same? ." "t" }
+    { $example "USING: kernel math prettyprint ;" "3 7 [ sq ] same? ." "f" }
+} ;
+
 HELP: execute
 { $values { "word" word } }
 { $description "Executes a word. Words which " { $link execute } " an input parameter must be declared " { $link POSTPONE: inline } " so that a caller which passes in a literal word can have a static stack effect." }