Files
el/tests/time/examples/time-comparison.el
Will Anderson e7c2fd02df add Instant + Duration as first-class types in El
Postfix literal syntax (30.seconds, 1.hour). Type-checked arithmetic
(Instant + Duration -> Instant; Instant + Instant fails). TTL helpers
backed by typed Duration. sleep(Duration) replaces ambiguous sleep(Int).

Self-host fixed point holds at 5797 lines.
Snapshot tagged at dist/platform/elc.20260502-1256-self-host.

Phase 2 (every/after/at scheduling primitives) lands separately.
Backlog: bl-937e9c30
2026-05-02 12:57:13 -05:00

17 lines
438 B
EmacsLisp

// time-comparison.el Duration < Duration is type-checked at codegen time.
// Both operands are DurationLits (postfix literals). Codegen routes through
// el_duration_lt; the runtime returns 1 when 5.minutes < 1.hour holds.
// `test` is reserved; using `run_test` instead.
fn run_test() -> Bool {
return 5.minutes < 1.hour
}
fn main() -> Void {
if run_test() {
println("1")
} else {
println("0")
}
}