Advertisement
Guest User

Untitled

a guest
May 1st, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. use nqp;
  2. class A { has num $.foo; has num $.baz };
  3. class B { has str $!bar };
  4. class C is A is B {
  5. method new(Num $a, Str $b) {
  6. my \SELF = nqp::create(self);
  7. nqp::bindattr_n(SELF, A, '$!foo', nqp::unbox_n($a));
  8. nqp::bindattr_n(SELF, A, '$!baz', nqp::unbox_n($a));
  9. nqp::bindattr_s(SELF, B, '$!bar', nqp::unbox_s($b));
  10. SELF
  11. }
  12. };
  13. C.new(5e0, "5").foo.WHAT.say
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement