docs(0.S): the doc fences migrated by ludic migrate state; LANGUAGE.md's state section says what the tool and the checker do now; no module-level var left in the docs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-25 15:37:29 +03:00
parent 19fcf60599
commit a476ec7976
79 changed files with 481 additions and 355 deletions

View file

@ -13,16 +13,18 @@ order: 3
```ludic
program ScoreModule {
var running_total: int = 0
@export function add_points(amount: int) -> int { # callable from a native host
running_total = running_total + amount
return running_total
state ScoreModuleState {
running_total: int = 0
}
entry {
print(add_points(10)) # 10
print(add_points(5)) # 15
@export function add_points(score_module_st: mut ScoreModuleState, amount: int) -> int { # callable from a native host
score_module_st.running_total = score_module_st.running_total + amount
return score_module_st.running_total
}
entry (score_module_st: mut ScoreModuleState) {
print(add_points(score_module_st, 10)) # 10
print(add_points(score_module_st, 5)) # 15
}
}
```

View file

@ -16,13 +16,15 @@ program BootHook {
property Health { current: int = 0, maximum: int = 100 }
model Player { Health }
var elapsed_frames: int = 0
@OnStart handler CreateWorld { # runs once at boot
spawn Player { Health { current: 100, maximum: 100 } }
elapsed_frames = 0
state BootHookState {
elapsed_frames: int = 0
}
handler CountFrames phase Update { elapsed_frames = elapsed_frames + 1 }
@OnStart handler CreateWorld(boot_hook_st: mut BootHookState) { # runs once at boot
spawn Player { Health { current: 100, maximum: 100 } }
boot_hook_st.elapsed_frames = 0
}
handler CountFrames(boot_hook_st: mut BootHookState) phase Update { boot_hook_st.elapsed_frames = boot_hook_st.elapsed_frames + 1 }
}
```