ludic/examples/modules/ports.ludic
Orkuncakilkaya 19fcf60599 wip(0.S3): packages and examples migrated again from their pre-0.S sources in one run
ludic migrate state packages <every example program> packages/ludic.lab/example/plate.ludic
  1804 vars into 126 states, 64 into lets; 23498 edits in 460 files

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 15:31:34 +03:00

15 lines
479 B
Text

# ports.ludic — L3 ports: module clock needs the time and declares `port Clock`; module app binds
# it with its own function; clock calls through `Clock.now()` and never names app. A member with a
# default (`day`) may be left out of the bind.
#
# Running it prints: 30 5
import "station/units"
import "station/clock"
import "station/app"
program Ports {
entry (app_st: mut AppState) {
let a = Clock.now()
advance(app_st, -25)
print(`{a} {hour_of_day()}`)
}
}