method usage-name

Documentation for method usage-name assembled from the following types:

class Parameter

From Parameter

(Parameter) method usage-name

Defined as:

method usage-name(Parameter:D: --> Str:D)

Returns the parameter name without any sigils and twigils.

If the parameter is anonymous, an empty string will be returned.

Note: Before Rakudo version 2020.08 the return value for an anonymous parameter was Nil.

my Signature $sig = :(Str $xStr @*lBool);
say $sig.params[0].usage-name;           # OUTPUT: «x␤» 
say $sig.params[1].usage-name;           # OUTPUT: «l␤» 
say $sig.params[2].usage-name;           # OUTPUT: «␤»