[Remind-Fans] Cleaning up OMITs

Jorge Luis lists at jorge.cc
Fri Nov 7 16:14:09 EST 2008


* "David F. Skoll" <dfs at roaringpenguin.com> [20081107 15:25 -0500]:
> This code appears to work correctly in all cases.
> 
> FSET prev_monday(x) x - wkdaynum(x-1)
> 
> # It is garbage day IFF:
> # 1) It's Tuesday, and neither Monday nor Tuesday is a holiday, OR
> # 2) It's Wednesday, and at least one of Monday or Tuesday was a holiday
> FSET garbage_day(x) \
>   wkdaynum(x) == 2 && nonomitted(prev_monday(x), x+1) == 2 || \
>   wkdaynum(x) == 3 && nonomitted(prev_monday(x), x) < 2
> 
> REM Tue Wed SATISFY [garbage_day(trigdate())] MSG Garbage Day

Brilliant!  Thank you.

	JL

-- 
JL <lists at jorge.cc>
This message optimized for teletypes.




More information about the Remind-fans mailing list