Skip to content

Commit

Permalink
doc CALL-ME
Browse files Browse the repository at this point in the history
  • Loading branch information
gfldex committed Sep 28, 2016
1 parent 1f30c68 commit f80d7e5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions doc/Type/Callable.pod6
Expand Up @@ -25,6 +25,22 @@ my &f:(Str) = -> Str {}; # Not yet implemented
=head1 Methods
=head2 method CALL-ME
method CALL-ME(Callable:D $self: |arguments)
This method is required for postfix:«( )» and postfix:«.( )». It's what makes
an object actually call-able and needs to be overloaded to let a given object
act like a routine. If the object needs to be stored in a C<&>-sigiled
container, is has to implement Callable.
class A does Callable {
submethod CALL-ME(|c){ 'called' }
}
my &a = A;
say a();
# OUTPUT«called␤»
=head2 method assuming
method assuming(Callable:D $self: |primers)
Expand Down

0 comments on commit f80d7e5

Please sign in to comment.