January 2024
Intermediate to advanced
718 pages
20h 15m
English
When invoking a method, the parentheses around the arguments may be omitted if the expression is otherwise unambiguous. So, foo 3, 4 as a line by itself is a legal call to foo with two arguments. Usually, the ambiguity happens if there are method calls in the arguments. If you had both foo and bar as methods, then foo 3, bar 4, 5 would trigger an error because the parser would attempt to resolve bar 4 as the second argument to foo. Fully parenthesizing as foo(3, bar(4, 5)) is preferred, but foo 3, (bar 4, 5) would also be legal.
Read now
Unlock full access