ablescript/examples/pass-by-reference.able
2022-04-18 21:42:26 +02:00

24 lines
356 B
Plaintext

owo Pass-by-reference test
owo Swap two variables.
functio swap(left, right) {
dim tmp left;
right =: left;
tmp =: right;
}
dim foo /*hello*/;
dim bar /*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;
}