ludic migrate state packages <every example program> packages/ludic.lab/example/plate.ludic 1804 vars into 126 states, 64 into lets; 23498 edits in 460 files Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
17 lines
494 B
Text
17 lines
494 B
Text
# hunting/index.ludic - a Catch and a Landed of its own, with other fields
|
|
module hunting
|
|
property Catch {
|
|
name: string = ""
|
|
weight: float = 0.0
|
|
}
|
|
event Landed { name: string }
|
|
export state HuntingState {
|
|
heard: string = ""
|
|
}
|
|
@On(Landed) handler Hear(hunting_st: mut HuntingState) { hunting_st.heard = hunting_st.heard + name }
|
|
export function hunting_day(hunting_st: HuntingState) -> string {
|
|
let c = new Catch
|
|
c.name = "hare"
|
|
emit Landed(name: c.name)
|
|
return hunting_st.heard
|
|
}
|