1 USING: help.syntax help.markup kernel prettyprint sequences
6 { $values { "generator" quotation } { "predicate" quotation } { "obj" object } }
7 { $description "Loop until the generator quotation generates an object that satisfies predicate quotation." }
9 "! Generate a random 20-bit prime number congruent to 3 (mod 4)"
10 "USING: combinators.lib math math.miller-rabin prettyprint ;"
11 "[ 20 random-prime ] [ 4 mod 3 = ] generate ."
16 { $values { "quot" quotation } { "n" integer } }
17 { $description "Calls the quotation " { $snippet "n" } " percent of the time." }
20 "[ \"hello, world! maybe.\" print ] 50 %chance"