forked from AbleScript/ablescript
Erin
e3d49c9c1f
- `dim <ident> [value];` is now used for declaration - `<value> =: <assignable>` is used for assignments - As token `=` doesn't cause any ambiguity now, it can be used for equals operation
24 lines
348 B
Plaintext
24 lines
348 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);
|
|
|
|
if (foo ain't /*world*/) {
|
|
/*FAILED*/ print;
|
|
/*foo should be 'world', is actually:*/ print;
|
|
foo print;
|
|
}
|
|
|
|
if (foo = /*world*/) {
|
|
/*OK*/ print;
|
|
}
|