ed564b6dda
Phase 1.5 of time-system. Calendar is pluggable: EarthCalendar (IANA zones, DST, Gregorian) is the default; MarsCalendar, CycleCalendar(period), NoCycleCalendar handle non-Earth cases. Rhythm abstracts recurrence from clock units - rhythm_cycle_phase(0.5) means "midpoint of cycle" whether the cycle is 24 hours on Earth or 30 hours on a station or 300 years on a long-cycle world. Phase 1 (Instant + Duration) unchanged. EarthCalendar(zone_local()) is the user-facing default; nobody who doesn't care about non-Earth calendars sees the abstraction. Self-host fixed point holds at 6339 lines. Snapshot tagged at dist/platform/elc.20260502-1321-self-host. Phase 2 (scheduling primitives every/after/at) lands next, now with Calendar-aware grounding instead of Earth-time hardcoded. Backlog: bl-297f66d8 (supersedes bl-b29b3e60)
17 lines
524 B
EmacsLisp
17 lines
524 B
EmacsLisp
// local-date-arithmetic.el — LocalDate + Duration produces a LocalDate.
|
|
// 2026-05-28 + 7 days crosses the May/June boundary, yielding 2026-06-04.
|
|
|
|
fn run_test() -> String {
|
|
let d1: LocalDate = local_date(2026, 5, 28)
|
|
let week: Duration = 7.days
|
|
let d2: LocalDate = d1 + week
|
|
let y: Int = local_date_year(d2)
|
|
let m: Int = local_date_month(d2)
|
|
let day: Int = local_date_day(d2)
|
|
return int_to_str(y) + "-" + int_to_str(m) + "-" + int_to_str(day)
|
|
}
|
|
|
|
fn main() -> Void {
|
|
println(run_test())
|
|
}
|