Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Clarifies privacy
Also clarifies example, closes #2420
  • Loading branch information
JJ committed Oct 28, 2018
1 parent 1952ca2 commit d2a09fe
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions doc/Type/Routine/WrapHandle.pod6
@@ -1,20 +1,25 @@
=begin pod
=TITLE class WrapHandle
=TITLE class Routine::WrapHandle
=SUBTITLE Holds all information needed to unwrap a wrapped routine.
class WrapHandle { ... }
C<WrapHandle> is created and returned by L<wrap|/type/Routine#method_wrap>. Its only use is to unwrap wrapped routines. Either call L<unwrap|/type/Routine#method_unwrap> on a routine object or call the method C<restore> on a C<WrapHandle> object.
C<WrapHandle> is a I<Rakudo private class> created and returned by
L<wrap|/type/Routine#method_wrap>. Its only use is to unwrap wrapped routines.
Either call L<unwrap|/type/Routine#method_unwrap> on a routine object or call
the method C<restore> on a C<Routine::WrapHandle> object.
sub f() { say 'f was called' }
my $wrap-handle = &f.wrap({ say 'before'; callsame; say 'after' });
f;
f; # OUTPUT: «before␤f was called␤after␤»
$wrap-handle.restore;
f;
# OUTPUT: «before␤f was called␤after␤f was called␤»
f; # OUTPUT: «f was called␤»
As such private class, it may suffer any kind of changes without prior notice.
It is only mentioned here since it is visible by the user who checks the return
type of the C<Routine.wrap> method.
=head1 Methods
Expand Down

0 comments on commit d2a09fe

Please sign in to comment.