This site is a static rendering of the Trac instance that was used by R7RS-WG1 for its work on R7RS-small (PDF), which was ratified in 2013. For more information, see Home.
Source for wiki CombinationsCowan version 1
author
cowan
comment
ipnr
127.11.51.1
name
CombinationsCowan
readonly
0
text
{{{
#!html
<dl>
<dt><a name="index-permutations_002dof"></a><code>make-permutation-generator</code><i> vector</i></dt>
<dd><p>Returns a generator that yields random permutations of <var>vector</var>.
</p>
<table><tr><td> </td><td><pre class="example">(generator->list (make-permutation-generator '(1 2 3)) 3)
⇒ ((1 2 3) (2 3 1) (3 2 1))
(generator->list (make-permutation-generator "abc") 3)
⇒ ("cba" "cba" "cab")
</pre></td></tr></table>
</dd></dl>
<dl>
<dt><a name="index-combinations_002dof"></a><code>make-combination-generator</code><i> size vector</i></dt>
<dd><p>Returns a generator that yields vectors of <var>size</var> elements
randomly picked from <var>vector</var>.
</p>
<table><tr><td> </td><td><pre class="example">(generator->list (make-combination-generatorh 2 #(a b c)) 5)
⇒ (#(a c) #(a b) #(a c) #(b a) #(a c))
(generator->list (make-combination-generator 2 '#(a b c)) 5)
⇒ (#(a c) #(b c) #(c b) #(b a) #(b c))
</pre></td></tr></table>
</dd></dl>
}}}
time
2017-06-16 01:58:11
version
1