In X::AdHoc§
See primary documentation in context for method from-slurpy.
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-slurpy( 3, False, "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.