method from-slurpy

Documentation for method from-slurpy assembled from the following types:

class X::AdHoc

From X::AdHoc

(X::AdHoc) method from-slurpy

Defined as

method from-slurpy (|cap)

Creates a new exception from a capture and returns it. The capture will have the SlurpySentry role mixed in, so that the .message method behaves in a different when printing the message.

try {
    X::AdHoc.from-slurpy3False"Not here" ).throw
};
print $!.payload.^name# OUTPUT: «Capture+{X::AdHoc::SlurpySentry}» 
print $!.message;       # OUTPUT: «3FalseNot here» 

The SlurpySentry role joins the elements of the payload, instead of directly converting them to a string.