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
|
|
@ -1,15 +1,13 @@
|
|||
# bank/ledger.ludic - inherits `module bank` from the barrel that imports it
|
||||
export state BankState {
|
||||
balance: int = 0
|
||||
}
|
||||
var balance: int = 0
|
||||
export event Deposited { amount: int }
|
||||
function add(bank_st: mut BankState, n: int) -> void {
|
||||
bank_st.balance += n
|
||||
function add(n: int) -> void {
|
||||
balance += n
|
||||
}
|
||||
export function deposit(bank_st: mut BankState, n: int) -> void {
|
||||
add(bank_st, n)
|
||||
export function deposit(n: int) -> void {
|
||||
add(n)
|
||||
emit Deposited(amount: n)
|
||||
}
|
||||
export function total(bank_st: BankState) -> int {
|
||||
return bank_st.balance
|
||||
export function total() -> int {
|
||||
return balance
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue