main()
{
int v = 2
double_me(v mut)
assert(v == 4)
a, b = plus_minus(5, 2)
assert(a==7 && b == 3)
c = plus_minus(20, 5)
d, e := c
assert(d==25 && e == 15)
result := double_array([5, 2, 1])
assert(result == [10, 4, 2])
if result.size < 3 return
result[0] = 123
assert(result == [123, 4, 2])
int_value = fnWithError(false) error {
return
}
}
double_me(int value mut) { value *= 2 }
plus_minus(int a, b) int, int { return a+b, a-b }
double_array(int[] array) int[] {
my_array := []
for v in array {
my_array.Push(v*2)
}
return my_array
}
fnWithError(bool b) int! {
if b { return InvalidParameter }
return 0
}