A port is a record of function values a module calls through (Clock.now()) without naming the module that answers. A port used and never bound, a bind missing a required member or naming one the port lacks, and a second bind are refused; the binder must see the port, and what it binds is checked from its own file. Reseed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
485 B
485 B
bump: minor
type: feature
Ports: port Clock { now: fn() -> int, day: fn() -> int = fn first_day } in a module and
bind Clock { now: fn game_hours } where the program is put together. A module asks for what it
needs through Clock.now() without naming - or uses-ing - the module that answers. A port used
and never bound, a bind that leaves out a member with no default, a member the port does not have
and a second bind are refused; the binder must see the (exported) port.