Most years have 52 weeks, some have 53, according to ISO8601.



Task

Write a function which determines if a given year is long (53 weeks) or not, and demonstrate it.




               DEFINE('DEC31WD(Year)')       :(END_DEC31WD)
DEC31WD        DEC31WD = REMDR(Year + (Year / 4) - (Year / 100) + (Year / 400), 7) :(RETURN)
END_DEC31WD
 
               DEFINE('ISOLONG(Year)')       :(END_ISOLONG)
ISOLONG        EQ(DEC31WD(Year), 4)          :S(RETURN)
               EQ(DEC31WD(Year - 1), 3)      :S(RETURN)F(FRETURN)
END_ISOLONG
 
               DEFINE('ISODEMO(Start,End)')  :(END_ISODEMO)
ISODEMO        OUTPUT = 'ISO long years between ' Start ' and ' End ':'
               Year = Start
LOOP           OUTPUT = ISOLONG(Year) Year
               Year = Year + 1
               LE(YEAR, 2045)                :S(LOOP) F(RETURN)
END_ISODEMO
 
                ISODEMO(1995, 2045)
END