method cando
Documentation for method cando
assembled from the following types:
class Code
From Code
(Code) method cando
method cando(Capture )
Returns a list of candidates that can be called with the given Capture. Since Code
objects do not have any multiple dispatch, this either returns a list with the object, or an empty list.
my = \'a'; # a single argument Capturemy = \('a', 42); # a two argument Capturemy = ; # a Block object, that is a subclass of Code, taking one argumentsay .cando(); # OUTPUT: «(-> $a { #`(Block|94212856419136) ... })»say .cando(); # OUTPUT: «()»
class Routine
From Routine
(Routine) method cando
method cando(Capture )
Returns a possibly-empty list of candidates that can be called with the given Capture, ordered by narrowest candidate first. For methods, the first element of the Capture needs to be the invocant:
.signature.say for "foo".^can("comb")[0].cando: \(Cool, "o");# OUTPUT: «(Cool $: Str $matcher, $limit = Inf, *%_)»