method make

Documentation for method make, assembled from the following types:

class Match

From Match

(Match) method make

method make(Match:D: Mu $payload)
sub make(Mu $payload)

Stores an arbitrary payload into the Match object that can later be retrieved via .made method.

This is typically used in a grammar's actions class methods, where a piece of data is stored by one method and then later retrieved by another. It's up to you what data you store. It could be a tree node, result of a calculation, or a list of values.

The sub form operates on the current $/, which can be a convenient shortcut:

method my-action ($/{
    make "foo: $/";
}