Advertisement
Guest User

Untitled

a guest
May 31st, 2024
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. #!env raku
  2.  
  3. role RA {
  4. method t () { callsame(); "RA".say; }
  5. }
  6.  
  7. role RB {
  8. method t () { callsame(); "RB".say; }
  9. }
  10.  
  11. my $c = anon class :: { method t () { "c".say; } };
  12.  
  13. for RA, RB -> $r {
  14. $c = $c but $r;
  15. }
  16.  
  17. $c.^roles.say;
  18.  
  19. $c.new.t;
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement