This file shows a number of syntax equivalences in the compiler.
Because of the multiple syntax equivalences, some expressions can be written in many different ways. All of the following do the same thing and compile to the same code.
You could even start expanding out the equivalent of (1..10) which is really a shortcut for series(1, nil, 10). This could also be written 1.series(nil,10). This adds another 26 variations to the 13 variations above.
NOTE: Trailing arguments must be literal blocks. No other expression may be used as a trailing argument, even if it evaluates to a Function. For example, you cannot use a variable name as a trailing argument, even if this variable was assigned a Function.
Using a selector as an infix binary operator (discussed in the next section) enables a visually similar construct that does allow arbitrary expressions as operands, but these binary-operator constructs technically do not have trailing arguments.
A fairly common case when this syntactic restriction matters: a partial application using the _ syntax is an expression evaluating to a Function, but it is not a literal block. Therefore:
WARNING: When switching between various forms of call syntax, one has to be mindful that a selector as a binary operator has equal precedence with most other binary operators, but has lower precedence than the receiver dot notation (.). Therefore, replacing a receiver syntax (dot) with a selector written as a binary operator can change the result of some expressions, as illustrated below:
Native infix operators like + can also be written in (longer) function-call form, e.g.:
infix:
function call:
1 + 2
(+)(1, 2)
The latter form is usually not a shortcut, except when one wants to dynamically change the adverb of an operator, for instance that of +++, because adverbs in the infix notation are interpreted as literals.