Handbook
Glossary
random-lines ( n -- lines )
Vocabulary
io
.
random
Inputs
n
an
object
Outputs
lines
an
object
Definition
USING:
io.random.private
kernel
math
random
sequences
sequences.private
;
IN:
io.random
::
random-lines
( n -- lines )
V{
}
clone
:>
accum
[|
line line# |
line# n
<=
[
line accum
push
]
[
line#
random
:>
r r n
<
[
line r accum
set-nth-unsafe
]
when
]
if
]
each-numbered-line
accum
;