]> gitweb.factorcode.org Git - factor.git/commitdiff
combinators: minor improvement to usage example of cond word
authorKeita Haga <keitahaga@mail.com>
Fri, 4 Feb 2011 08:53:00 +0000 (17:53 +0900)
committerKeita Haga <keitahaga@mail.com>
Fri, 4 Feb 2011 08:53:00 +0000 (17:53 +0900)
core/combinators/combinators-docs.factor

index 9c22221e70130a1f1a8dcc3a983073adbc591980..f408a44257c7bb45c3e40e321f11aba268d903f1 100644 (file)
@@ -326,12 +326,14 @@ HELP: cond
 }
 { $errors "Throws a " { $link no-cond } " error if none of the test quotations yield a true value." }
 { $examples
-    { $code
-        "{"
-        "    { [ dup 0 > ] [ \"positive\" ] }"
-        "    { [ dup 0 < ] [ \"negative\" ] }"
-        "    [ \"zero\" ]"
-        "} cond"
+    { $example
+        "USING: combinators io kernel math ;"
+        "0 {"
+        "    { [ dup 0 > ] [ drop \"positive\" ] }"
+        "    { [ dup 0 < ] [ drop \"negative\" ] }"
+        "    [ drop \"zero\" ]"
+        "} cond print"
+        "zero"
     }
 } ;