]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/random/random-docs.factor
factor: trim using lists
[factor.git] / basis / random / random-docs.factor
index 6777e1be1a5f9ea771ae843da336449f2d950915..974e0bd40f24e0943141d1b8cae340889f3d6e1f 100644 (file)
@@ -1,5 +1,6 @@
-USING: help.markup help.syntax math kernel sequences arrays ;
-IN: random
+USING: arrays help.markup help.syntax kernel math quotations random
+sequences ;
+IN: combinators.random
 
 HELP: seed-random
 { $values
@@ -14,8 +15,8 @@ HELP: random-32*
 { $description "Generates a random 32-bit unsigned integer." } ;
 
 HELP: random-bytes*
-{ $values { "n" "an integer" } { "obj" "a random number generator" } { "byte-array" "a sequence of random bytes" } }
-{ $description "Generates a byte-array of random bytes." } ;
+{ $values { "n" integer } { "obj" "a random number generator" } { "byte-array" "a sequence of random bytes" } }
+{ $description "Generates a byte-array of " { $snippet "n" } " random bytes." } ;
 
 HELP: random
 { $values { "obj" object } { "elt" "a random element" } }
@@ -36,9 +37,9 @@ HELP: random-32
 { $description "Outputs 32 random bits. This word is more efficient than calling " { $link random } " because no scaling is done on the output." } ;
 
 HELP: random-bytes
-{ $values { "n" "an integer" } { "byte-array" "a random integer" } }
-{ $description "Outputs an integer with n bytes worth of bits." }
-{ $examples 
+{ $values { "n" integer } { "byte-array" "a sequence of random bytes" } }
+{ $description "Generates a byte-array of " { $snippet "n" } " random bytes." }
+{ $examples
     { $unchecked-example "USING: prettyprint random ;"
                "5 random-bytes ."
                "B{ 135 50 185 119 240 }"
@@ -48,7 +49,7 @@ HELP: random-bytes
 HELP: random-integers
 { $values { "length" integer } { "n" integer } { "sequence" array } }
 { $description "Outputs an array with " { $snippet "length" } " random integers from [0,n)." }
-{ $examples 
+{ $examples
     { $unchecked-example "USING: prettyprint random ;"
                "10 100 random-integers ."
                "{ 32 62 71 89 54 12 57 57 10 19 }"
@@ -62,7 +63,7 @@ HELP: random-unit
 HELP: random-units
 { $values { "length" integer } { "sequence" array } }
 { $description "Outputs an array with " { $snippet "length" } " random uniform floats from [0,1]." }
-{ $examples 
+{ $examples
     { $unchecked-example "USING: prettyprint random ;"
                "7 random-units ."
                "{
@@ -79,23 +80,23 @@ HELP: random-units
 
 HELP: random-bits
 { $values { "numbits" integer } { "n" "a random integer" } }
-{ $description "Outputs an random integer n bits in length." } ;
+{ $description "Outputs a random integer " { $snippet "numbits" } " bits in length." } ;
 
 HELP: random-bits*
 { $values { "numbits" integer } { "n" "a random integer" } }
-{ $description "Returns an integer exactly " { $snippet "numbits" } " in length, with the topmost bit set to one." } ;
+{ $description "Returns an integer exactly " { $snippet "numbits" } " bits in length, with the topmost bit set to one." } ;
 
 HELP: with-random
-{ $values { "obj" "a random number generator" } { "quot" "a quotation" } }
-{ $description "Calls the quotation with the random number generator in a dynamic variable.  All random numbers will be generated using this random number generator." } ;
+{ $values { "obj" "a random number generator" } { "quot" quotation } }
+{ $description "Calls the quotation with the random number generator in a dynamic variable. All random numbers will be generated using this random number generator." } ;
 
 HELP: with-secure-random
-{ $values { "quot" "a quotation" } }
-{ $description "Calls the quotation with the secure random number generator in a dynamic variable.  All random numbers will be generated using this random number generator." } ;
+{ $values { "quot" quotation } }
+{ $description "Calls the quotation with the secure random number generator in a dynamic variable. All random numbers will be generated using this random number generator." } ;
 
 HELP: with-system-random
-{ $values { "quot" "a quotation" } }
-{ $description "Calls the quotation with the system's random number generator in a dynamic variable.  All random numbers will be generated using this random number generator." } ;
+{ $values { "quot" quotation } }
+{ $description "Calls the quotation with the system's random number generator in a dynamic variable. All random numbers will be generated using this random number generator." } ;
 
 { with-random with-secure-random with-system-random } related-words