Advertisement
Guest User

Untitled

a guest
Oct 11th, 2011
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 6 0.34 KB | None | 0 0
  1. class Absolute is Int {};
  2. class Relative is Int {};
  3.  
  4. multi sub a(Absolute $x) {
  5.     say "Absolute";
  6. }
  7.  
  8. multi sub a(Relative $x) {
  9.     say "Relative";
  10. }
  11.  
  12. a(Absolute.new());
  13. a(Relative.new());
  14.  
  15. my Absolute $x = 3;  #doesnt work
  16. my Relative $x = 3;  #doesnt work
  17. my Absolute $x .= new(3);  #doesnt work
  18. my Relative $x .= new(3);  #doesnt work
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement