(sigil later)
(sigil later) - Cron expression parsing and time matching.
Parses standard 5-field cron expressions into schedule structs and provides pure functions for testing timestamps against them.
(let ((sched (parse-cron-string "*/5 * * * *")))
(later-matches? sched (current-second))
(later-next sched (current-second)))Exports
later-scheduleprocedureConstruct a later-schedule struct.
later-schedule?procedureTest if a value is a later-schedule struct.
later-schedule-minutesprocedureGet the minutes field of a later-schedule struct.
later-schedule-hoursprocedureGet the hours field of a later-schedule struct.
later-schedule-days-of-monthprocedureGet the days-of-month field of a later-schedule struct.
later-schedule-monthsprocedureGet the months field of a later-schedule struct.
later-schedule-days-of-weekprocedureGet the days-of-week field of a later-schedule struct.
parse-cron-stringprocedureParse a standard 5-field cron string into a schedule.
Fields: minute hour day-of-month month day-of-week
Supports: , numbers, ranges (1-5), lists (1,3,5), steps (/5, 1-10/2), named days (MON-FRI), named months (JAN-DEC).
later-matches?procedureTest whether a Unix timestamp matches a cron schedule.
later-nextprocedureFind the next timestamp after ts that matches the schedule.
Searches minute-by-minute, jumping forward when higher-order fields don't match. Returns a Unix timestamp or #f if no match is found within 366 days.