>>>>> "DS" == Dan Sugalski <[EMAIL PROTECTED]> writes:

  >> so any class X that inherits from B must also modify the PARENT property
  >> in B? that sounds like PARENT is a hash of the classes which inherit
  >> from B.

  DS> Yep. Basically if the inheriting class is of a different type, such that
  DS> the parent class must be inherited with delegation, then when the parent
  DS> object is instantiated it gets the PARENT property on it. Messy in some
  DS> ways, but I don't see any way around it.

the use of 'inherit' with delegation bothers me. that assumes (some of)
the method names in the owned object are the same in the owner (parent)
object. 

  >> how does that handle which methods in the 'owner' object get
  >> mapped/delegated to which methods in the 'owned' object? damian's
  >> delegate module has a map for that with owner method names mapping to
  >> attribute (owned object)/method pairs. not all methods of an owned
  >> object need to be accessible via the owner's interface. also how do you
  >> handle multiple owned objects and method mapping?

  DS> Ah, this isn't for the Damian "We do Interesting Things with delegation"
  DS> stuff. This mechanism is in specifically to handle inheriting from an
  DS> incompatible parent class. Stuff like Damian wants can be handled
  DS> completely in user-code, so it should be.

i assume by user code you mean perl6 itself? that can be done just
before method lookup is called but the mapping hash still has to be in
the object/class and private to that. can that be handled at the perl6
level without parrot support?

  DS> At some point someone will come up with a clever general way to handle
  DS> this, in which case we'll look into rolling it into the base object
  DS> system, but for now, in the interests of what simplicity we can muster,
  DS> we're going to duck the issue.

it doesn't seem to be too hard. all that is needed is a OWNED/DELEGATED
hash with the method/delegated mappings provided by perl6. then that map
(if it exists) is checked before any other method lookups are done. this
is all i see that is needed to support proper delegation and it is
pretty much what damian's module does now. it can be added later if it
simplifies things now but it doesn't seem that complex or tricky.

uri

-- 
Uri Guttman  ------  [EMAIL PROTECTED]  -------- http://www.stemsystems.com
----- Stem and Perl Development, Systems Architecture, Design and Coding ----
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org
Damian Conway Perl Classes - January 2003 -- http://www.stemsystems.com/class

Reply via email to