I6: Rerouting all actions of one object to another

I’m trying to have detailed descriptions of facets of the same overall object. So I implemented one main object with a long before block defining its behaviour. Details are implemented as their own object with just a description. All other actions aimed at a detail object should be rerouted to the parent object. I tried the following before rule:

default: <<action_to_be parentobj>>;

The compiler complains about there not being a sub for that.

Then, I tried this:

default: noun = parentobj;

This actually gets me further. The action is correctly executed with the intended object. However, the before block of parentobj is skipped! So only the default library rules and messages are applied.

So, is there any way to “restart” the action to make all those overrides applicable again? Or is there a variable I’m missing which holds the action in a way usable for the <<>> syntax? Mabye someone knows another solution (short of rerouting all actions individually)?

This isn’t optimal, but I can’t think of a better way:

noun = parentobj;
if(parentobj provides before) return parentobj.before();

This seems to do the trick, thanks a lot. For future reference, in case anyone else wants to do this, the pitfall of this solution is that you need to give all attributes of the parent object also to the child. Otherwise, if your parent is switchable, SWITCH ON CHILD will still be rejected.

default: <<(action) parentobj second>>;

Another syntax weirdness demystified - thanks!

If the first argument in << >> or < > is parenthesized, it’s parsed as an expression. If not, it must be a bare action name. So <> is a shortcut for <<(##Look)>>, really.