Handbook
Glossary
closest-day ( timestamp n -- timestamp' )
Vocabulary
calendar
.
private
Inputs
timestamp
an
object
n
an
object
Outputs
timestamp'
an
object
Definition
USING:
calendar
kernel
math
sequences
;
IN:
calendar.private
:
closest-day
( timestamp n -- timestamp' )
[
dup
day-of-week
7
swap
-
]
[
+
7
mod
]
bi*
{
0 1 2 3 -3 -2 -1
}
nth
days
time+
;