Reblessing is sooo 90 :-)
Why not use role-playing composition to achieve your goal?
role MyWay { method say(|) { note "whee"; nextsame } } my $*OUT = PROCESS::<$OUT> but MyWay; $*OUT.say("foo")
Basically, a new dynamic $*OUT based on the existing $*OUT , but with a new mixed say method.
To answer your questions, as well as I can:
- rebempting is considered something internal that you most likely don't want to do
- many built-in classes are optimized for speed without using the standard way to create objects. This sorting makes it difficult to subclass them. In some cases, custom code reverts to standard ways of creating objects, making these classes subclassed after all (for example,
Date ). - In general, I would say that a low-level game is not recommended, as there are still internal refactories to speed things up, which could break your code if you play too little.
Since say internally uses print , it would be better to actually mix your own print method:
role MyWay { method print(|) { note "whee"; nextsame } } my $*OUT = PROCESS::<$OUT> but MyWay; say "foo";
This has the added benefit of no longer having to say as a method, because the sub version of say will dynamically change the changed $*OUT .
source share