Code: Select all
if:
{ x: true, y.
y.
}
{ x: false, y. } <-- no error, but do nothing
while:
{ x: bool, y.
if x,
{ .
y.
while x, y.
}
}
for:
{ stop: int, block.
start: 0.
step: 1.
for start, stop, step, block.
}
{ start: int, stop: int, block.
step: 1.
for start, stop, step, block.
}
{ start: int, stop: int, step: int, block.
i: int; = start.
while (i between start, stop),
{ .
block start.
i += step.
}
}
foreach:
{ x: enumerable, block. <-- enumerable is the prototype to a bunch of objects, like lists
for 0, x length, 1,
{ i.
block (x i). <-- i is the index in the enumerable x
}
}
Code: Select all
isEven:
{ x: Int where (x % 2 == 0).
^true.
}
{ x: Int. <-- less specific so gets called otherwise
^false.
}