]> gitweb.factorcode.org Git - factor.git/commitdiff
combinators.random: fix a couple of usage examples in casep and casep*
authorKeita Haga <keitahaga@mail.com>
Sat, 19 Feb 2011 18:38:54 +0000 (03:38 +0900)
committerKeita Haga <keitahaga@mail.com>
Sat, 19 Feb 2011 18:51:09 +0000 (03:51 +0900)
basis/combinators/random/random-docs.factor

index 2fc0b8c00ecba016a65b40fb8b6fe077e4e14150..826474420c9017b2933ef3ceecbc5e174403e8d1 100644 (file)
@@ -32,17 +32,21 @@ HELP: casep
 { $examples
     "The following two forms will output 1 with 0.2 probability, 2 with 0.3 probability and 3 with 0.5 probability"
     { $code
-        "USING: combinators.random ;"
-        "{ { 0.2 [ 1 ] }"
-        "  { 0.3 [ 2 ] }"
-        "  { 0.5 [ 3 ] } } casep ."
+        "USING: combinators.random prettyprint ;"
+        "{"
+        "    { 0.2 [ 1 ] }"
+        "    { 0.3 [ 2 ] }"
+        "    { 0.5 [ 3 ] }"
+        "} casep ."
     }
     $nl
     { $code
-        "USING: combinators.random ;"
-        "{ { 0.2 [ 1 ] }"
-        "  { 0.3 [ 2 ] }"
-        "  { [ 3 ] } } casep ."
+        "USING: combinators.random prettyprint ;"
+        "{"
+        "    { 0.2 [ 1 ] }"
+        "    { 0.3 [ 2 ] }"
+        "    [ 3 ]"
+        "} casep ."
     }
 
 }
@@ -62,17 +66,21 @@ HELP: casep*
 { $examples
     "The following two forms will output 1 with 0.5 probability, 2 with 0.25 probability and 3 with 0.25 probability"
     { $code
-        "USING: combinators.random ;"
-        "{ { 0.5 [ 1 ] }"
-        "  { 0.5 [ 2 ] }"
-        "  { 1 [ 3 ] } } casep* ."
+        "USING: combinators.random prettyprint ;"
+        "{"
+        "    { 0.5 [ 1 ] }"
+        "    { 0.5 [ 2 ] }"
+        "    { 1 [ 3 ] }"
+        "} casep* ."
     }
     $nl
     { $code
-        "USING: combinators.random ;"
-        "{ { 0.5 [ 1 ] }"
-        "  { 0.5 [ 2 ] }"
-        "  { [ 3 ] } } casep* ."
+        "USING: combinators.random prettyprint ;"
+        "{"
+        "    { 0.5 [ 1 ] }"
+        "    { 0.5 [ 2 ] }"
+        "    [ 3 ]"
+        "} casep* ."
     }
 
 }