Renamed 'scripts' directory to 'examples'

Also allowed assignment within conditionals
This commit is contained in:
2026-05-26 23:40:18 +10:00
parent bbb1e38649
commit 92e4a41662
14 changed files with 34 additions and 110 deletions
+21
View File
@@ -0,0 +1,21 @@
fn makeCounter() {
var counter: Int = 0;
fn increment() {
return ++counter;
}
return increment;
}
//'tally' becomes a closure
var tally = makeCounter();
var result = 0;
while (result = tally()) {
print result;
if (result >= 10) {
break;
}
}