From c997e43ca8e9ea40dabc97061da1daddf6968af2 Mon Sep 17 00:00:00 2001 From: Keita Haga Date: Fri, 4 Feb 2011 17:53:00 +0900 Subject: [PATCH] combinators: minor improvement to usage example of cond word --- core/combinators/combinators-docs.factor | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/core/combinators/combinators-docs.factor b/core/combinators/combinators-docs.factor index 9c22221e70..f408a44257 100644 --- a/core/combinators/combinators-docs.factor +++ b/core/combinators/combinators-docs.factor @@ -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" } } ;