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:
parent
19fcf60599
commit
a476ec7976
79 changed files with 481 additions and 355 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue