Ovid wrote:
----- Original Message ----
From: Timothy S. Nelson <wayl...@wayland.id.au>

class PracticalJoke {
    has Bomb $bomb handles ;
    has Spouse $spouse handles ;
}

Note that I have no idea where (if anywhere) the type goes in this. Hopefully someone will correct me here. Note that this does not use the roles as roles; it uses them punned as classes. But it does what you asked :).


Though I have issues with Jonathan's approach (I don't like classes silently discarding role methods as this has caused us many bugs at the BBC), it's much cleaner that what I see here.
s/Jonathan's approach/Perl 6's approach/ # at least, so far as I understand Perl 6

Jonathan

Reply via email to