wip(0.S2): migrate - a var nothing writes becomes a let; a state is keyed by its module, directory or program, so every program's plan agrees; paths normalized; program states named SceneDemoState / scene_demo_st; the LSP reads state, mut and entry/handler parameters
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
3eda72e8c2
commit
5ffe50ed02
463 changed files with 72045 additions and 67421 deletions
|
|
@ -6,18 +6,16 @@
|
|||
#
|
||||
# Running it prints: 16 (the cycle bottoms out at the depth cap, deterministically)
|
||||
program Recurse {
|
||||
state RecurseState {
|
||||
n: int = 0
|
||||
}
|
||||
var n: int = 0
|
||||
|
||||
event Ping { }
|
||||
event Pong { }
|
||||
|
||||
@On(Ping) handler A(recurse_st: mut RecurseState) { recurse_st.n += 1; emit Pong() } # each Ping deepens by one Pong
|
||||
@On(Ping) handler A { n += 1; emit Pong() } # each Ping deepens by one Pong
|
||||
@On(Pong) handler B { emit Ping() } # ...and each Pong by one Ping
|
||||
|
||||
entry (recurse_st: RecurseState) {
|
||||
entry {
|
||||
emit Ping()
|
||||
print(recurse_st.n)
|
||||
print(n)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue