in reply to Re^3: Beyond Inside-Out
in thread Beyond Inside-Out
The focus of Tye's concerns is the fact that the ego() function uses its caller to decide which alter ego to produce. Here, "caller" means the package that was in force when the call to ego() was compiled. Now, it is possible to do things like
That would indeed produce an anomaly: A method in class Bar that accesses the ego belonging to Foo. On the other hand, that would be the described behavior, for better or worse. It isn't something that easily happens by accident while you're writing your accessors. It may even be useful in some situations, I haven't thought about it much. In general, the Alter-approach assumes that methods are compiled in the class their name resides in.package Foo; sub Bar::method { my $ego = ego($_[0]); ... }
Tye has another objection which I'm not sure I understand. If I understand it right it is about qualified method calls, in the form
but I think an Alter-based class would behave exactly as it should with these.$obj->Class::method(...);
Anno
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Beyond Inside-Out
by xdg (Monsignor) on May 30, 2007 at 13:14 UTC | |
by Anno (Deacon) on May 30, 2007 at 14:10 UTC | |
by xdg (Monsignor) on May 30, 2007 at 14:46 UTC | |
by clinton (Priest) on May 30, 2007 at 15:17 UTC | |
by xdg (Monsignor) on May 30, 2007 at 18:17 UTC | |
| |
by Anno (Deacon) on May 30, 2007 at 18:12 UTC |