]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/combinators/random/random-docs.factor
factor: trim using lists
[factor.git] / basis / combinators / random / random-docs.factor
index 2fc0b8c00ecba016a65b40fb8b6fe077e4e14150..26eeadc796a0fa3b3263153395b2f1db9ab6163d 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2010 Jon Harper.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: assocs help.markup help.syntax kernel quotations
-combinators.random.private sequences ;
+USING: arrays combinators.random.private help.markup help.syntax
+kernel math quotations random sequences ;
 IN: combinators.random
 
 HELP: call-random
@@ -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* ."
     }
 
 }