Handbook
Glossary
leap-year? ( obj -- ? )
Calendar
ยป
Year operations
Next:
days-in-year ( obj -- n )
Vocabulary
calendar
Inputs
obj
an
object
Outputs
?
a
boolean
Word description
Returns
t
if the object represents a leap year.
Examples
USING: calendar prettyprint ; 2008 leap-year? .
t
USING: calendar prettyprint ; 2010 1 1 <date> leap-year? .
f
Definition
IN:
calendar
GENERIC:
leap-year?
( obj -- ? )
Methods
USING:
calendar
kernel
math
math.functions
;
M:
integer
leap-year?
dup
100
divisor?
400 4
?
divisor?
;
USING:
accessors
calendar
;
M:
timestamp
leap-year?
year>>
leap-year?
;