Documentation for routine ( )

Documentation for routine ( ), assembled from the following types:

language documentation Operators

From Operators

(Operators) term ( )

The grouping operator.

An empty group () creates an empty list. Parentheses around non-empty expressions simply structure the expression, but do not have additional semantics.

In an argument list, putting parenthesis around an argument prevents it from being interpreted as a named argument.

multi sub p(:$a!{ say 'named'      }
multi sub p($a)   { say 'positional' }
p => 1;           # OUTPUT: «named␤» 
p (=> 1);         # OUTPUT: «positional␤» 

language documentation Operators

From Operators

(Operators) postcircumfix ( )

The call operator treats the invocant as a Callable and invokes it, using the expression between the parentheses as arguments.

Note that an identifier followed by a pair of parentheses is always parsed as a subroutine call.

If you want your objects to respond to the call operator, you need to implement a method CALL-ME.