upvalue.lox (260B)
1 fun Test(inc) { 2 var upval = 0; 3 return class { 4 init() { 5 this.inc = inc; 6 } 7 method() { 8 print(upval); 9 upval = upval + inc; 10 } 11 }; 12 } 13 14 con test = Test(3)(); 15 16 test.method(); 17 test.method();
DzLox:) | |
| git clone https://git.sr.ht/~ashymad/DzLox | |
| Log | Files | Refs | Submodules | LICENSE |