Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 6 0.26 KB | None | 0 0
  1. #!/usr/bin/env perl6
  2.  
  3. use v6;
  4.  
  5. class Foo {
  6.     has Str $.emoji = '🐈=';
  7.     submethod TWEAK {
  8.         say self.emoji;
  9.     }
  10. }
  11.  
  12. class Bar is Foo {
  13.     my Str $.emoji = '🐩=';
  14. }
  15.  
  16. my $foo = Foo.new;
  17. say $foo.emoji;
  18. my $bar = Bar.new;
  19. say $bar.emoji;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement