phase: 20.49 COMPLETE; 20.50 Flow+String minimal reps; 20.51 selfhost v0/v1 minimal (Option A/B); hv1-inline binop/unop/copy; docs + run_all + CURRENT_TASK -> 21.0
This commit is contained in:
18
apps/box-field-decl-demo/main.hako
Normal file
18
apps/box-field-decl-demo/main.hako
Normal file
@ -0,0 +1,18 @@
|
||||
// box field declaration demo (P0)
|
||||
box Counter {
|
||||
count: IntegerBox
|
||||
public { name }
|
||||
|
||||
birth(name) {
|
||||
me.name = name
|
||||
me.count = 0
|
||||
}
|
||||
|
||||
inc() { me.count = me.count + 1 }
|
||||
get() { return me.count }
|
||||
}
|
||||
|
||||
local c = new Counter("nyash")
|
||||
c.inc()
|
||||
local con = new ConsoleBox()
|
||||
con.println(c.get())
|
||||
Reference in New Issue
Block a user