Partial application is a way to create a function by passing only some arguments to a method. The _ character stands in for missing arguments and becomes an argument to the created function. It only applies to a single method, list, or dictionary call, not to a more complex nested expression.

for example:

f = _ + 2;

f is now a function of one argument.

f.value(7);

it is equivalent to having written:

f = {|x| x + 2 };

(except that there is no name 'x' declared)

g = Point(_, _);

g is a function of two arguments.

g.value(3, 4);

Here are some example usages of this in a collect message. Below each is written the equivalent function.