Handbook
Glossary
pad-groups ( seq n elt -- padded )
Vocabulary
grouping
.
extras
Inputs
seq
a
sequence
n
an
integer
elt
an
object
Outputs
padded
an
object
Word description
Pads
seq
at the end with element
elt
such that its length is divisible by
n
.
Definition
USING:
kernel
math
sequences
;
IN:
grouping.extras
::
pad-groups
( seq n elt -- padded )
seq
dup
length
dup
n
mod
[
drop
]
[
n
swap
-
+
elt
pad-tail
]
if-zero
;