To further extend Steve's argument (which I wholeheartedly agree
with), I wanted to point out one thing: &bless has nothing to do with
OO programming as conceived of in Perl6. It does one thing and only
one thing:
     - tag a reference with a package name.

This is used in a few places:
    - to determine what package the 'meth' function lives in when the
syntax $foo->meth( @parms ) is encountered
    - to determine what ref() should return

There are no references in Perl6. In fact, the only think you have in
Perl6 is objects, so why do we need to take something that isn't an
object (which doesn't exist) and do anything to it, let alone tag it
with a package name? Packages don't have anything to do with the class
system. If you want to change the behavior of something at runtime,
you can do so through .meta, roles, mixins, traits, and the like.

&bless was a brilliant idea for Perl5. It's wrong for Perl6.


Reply via email to