Advertisement
Guest User

Untitled

a guest
Oct 10th, 2015
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. use v6;
  2.  
  3. unit class Returnable;
  4.  
  5. multi method return(Any $any) is export {
  6. say "return";
  7. }
  8.  
  9. method apply(Block $block) {
  10. my $ret = $block.();
  11. say "foo";
  12. $ret;
  13. }
  14.  
  15.  
  16. my $r = Returnable.new;
  17.  
  18. $r.apply(-> {
  19. return 1;
  20. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement