Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add cando example with Block
  • Loading branch information
Altai-man committed May 17, 2019
1 parent 3bbea96 commit b25e802
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doc/Type/Code.pod6
Expand Up @@ -145,6 +145,12 @@ Returns a list of candidates that can be called with the given
L<Capture|/type/Capture>. Since C<Code> objects do not have any multiple
dispatch, this either returns a list with the object, or an empty list.
my $single = \'a'; # a single argument Capture
my $plural = \'a', 42; # a two argument Capture
my &block = { say $^a }; # a Block object, that is a subclass of Code, taking one argument
say &block.cando($single); # OUTPUT: «(-> $a { #`(Block|94212856419136) ... })␤»
say &block.cando($plural); # OUTPUT: «()␤»
=head2 method Str
Defined as:
Expand Down

0 comments on commit b25e802

Please sign in to comment.