better factoring for us-federal-holiday?

db4
Doug Coleman 2009-11-12 14:48:55 -06:00
parent 16af61bfbd
commit 9ccc22304d
1 changed files with 6 additions and 6 deletions

View File

@ -37,9 +37,15 @@ SYNTAX: HOLIDAY-NAME:
: us-federal-holidays ( timestamp/n -- seq )
us-federal find-holidays [ adjust-federal-holiday ] map ;
: us-federal-holiday? ( timestamp/n -- ? )
dup us-federal-holidays [ same-day? ] with any? ;
: canadian-holidays ( timestamp/n -- seq )
canada find-holidays ;
: post-office-open? ( timestamp -- ? )
{ [ sunday? not ] [ us-federal-holiday? not ] } 1&& ;
HOLIDAY: new-year's-day january 1 >>day ;
HOLIDAY-NAME: new-year's-day world "New Year's Day"
HOLIDAY-NAME: new-year's-day us-federal "New Year's Day"
@ -135,9 +141,3 @@ HOLIDAY: black-friday thanksgiving-day 1 days time+ ;
HOLIDAY: pearl-harbor-remembrance-day december 7 >>day ;
HOLIDAY: new-year's-eve december 31 >>day ;
: post-office-open? ( timestamp -- ? )
{
[ sunday? not ]
[ dup us-federal-holidays [ same-day? ] with any? not ]
} 1&& ;