ludic/examples/rejected/port_private.ludic
Orkuncakilkaya b1ccaf08bd feat(lang): ports - port Clock { ... } in a module, bind Clock { ... } in the app
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>
2026-09-25 04:20:12 +03:00

11 lines
225 B
Text

# L3: whoever binds a port has to see it - clock's Clock is not exported
import "port_clock"
program PortPrivate {
function hours() -> int {
return 3
}
bind Clock { now: fn hours }
entry {
print(tell())
}
}