ablescript/examples/pass-by-reference.able
2022-06-03 00:10:19 +02:00

24 lines
356 B
Plaintext

owo Pass-by-reference test
owo Swap two variables.
functio swap(left, right) {
tmp dim left;
right =: left;
tmp =: right;
}
foo dim /*hello*/;
bar dim /*world*/;
swap(foo, bar);
unless (foo = /*world*/) {
/*FAILED*/ print;
/*foo should be 'world', is actually:*/ print;
foo print;
}
unless (foo ain't /*world*/) {
/*OK*/ print;
}