forked from AbleScript/ablescript
24 lines
356 B
Plaintext
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;
|
|
}
|