ablescript/examples/by-arity-chain.able
Erin eac86b5e0b Changed variable declaration / assignment and equals syntax:
- `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
2022-04-18 20:34:08 +02:00

45 lines
800 B
Plaintext

functio arity_0() {
/*this function has arity 0*/ print;
}
functio arity_1(arg1) {
/*this function has arity 1*/ print;
arg1 print;
}
functio arity_2(arg1, arg2) {
/*this function has arity 2*/ print;
arg1 print;
arg2 print;
}
functio arity_3(arg1, arg2, arg3) {
/*this function has arity 3*/ print;
arg1 print;
arg2 print;
arg3 print;
}
owo arity_0();
owo arity_1(/*foo*/);
owo arity_2(/*foo*/, /*bar*/);
owo arity_3(/*foo*/, /*bar*/, /*baz*/);
dim i1 arity_0 * arity_1;
i1(/*second*/);
/*----*/ print;
dim i2 arity_1 * arity_0;
i2(/*first*/);
/*----*/ print;
dim ifancy arity_3 * arity_3;
ifancy(/*left1*/, /*right1*/, /*left2*/, /*right2*/, /*left3*/, /*right3*/);
/*---*/ print;
dim another arity_0 * arity_3;
another(/*right1*/, /*right2*/, /*right3*/);