On Thu, Apr 29, 2004 at 01:56:30PM +0200, Aldo Calpini wrote:
: On Fri, 2004-04-23 at 17:24, Larry Wall wrote:
: > [...]
: >
: > On the sixth hand, by that argument, since .dispatcher is aiming at
: > a Class, it should be an uppercase C<>. :-)
:
: why not wash all these hands altogether?
:
: IDEA 1
:
: implementing a "final" trait should be trivial enough (it just throws an
: exception when, at class construction time, it sees a method that is eq
: a base method marked final). so this could be something like (pretending
: Object will be written in P6 rather than "gloriously grungy C code" :-):
:
: class Object {
: has MetaClass $.meta is final;
: }
:
: this would also allow the following code to not compile:
:
: class HumanBeing {
: method die is final {
: $_.rest_in_peace();
: }
: }
:
: class Zombie is HumanBeing {
: method die {
: return undef;
: }
: }
:
: so long for B-series splatter movies, but hey :-)
But what if someone has a good reason to override .meta? I basically
hate the idea of "final" in any form, I guess.
: IDEA 2
:
: since the .meta method should be the first thing in the inheritance tree
: (unless you negate somehow your inheritance from Object, but in this
: case you are supposed to know what you're doing), even if you overload
: it, the "correct" .meta should always be available as:
:
: ($obj.+meta)[-1]
:
: and once we have $obj.+meth, $obj.*meth and $obh.?meth modeled after
: regexp modifiers, I see no reason why we shouldn't have:
:
: $obj.^meta
:
: which, calling the most derived method, should always do the Right
: Thing.
Except you want the least derived method, which would be $obj.$meta,
which already means something else...
Larry