guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Delegation in goops?


From: Alan Grover
Subject: Re: Delegation in goops?
Date: Fri, 03 Mar 2006 13:44:25 -0500
User-agent: Mozilla Thunderbird 1.0.6 (X11/20050716)

I had previously asked about delegation in goops, and had proposed an
ugly solution.

I think I see another solution, since the effect I think I'm looking for
is effectively subclassing but using an already allocated object. 1) If
I create a subclass of the delegatee, I get the proper GF dispatch.
Thus, by default, all GF's are "delegated" unless I override. 2) If I
share the allocated object, than the state is affected as expected.

Subclassing is easy, even "dynamically," since I can get the class of an
object, and modify the delegator's super-classes.

It appears that I can customize the getter/setter methods at class
creation time, so I could construct "delegate" functions for the
knowable list (and presumably, re-construct if the delegatee class
changes). If I didn't want any slots in my delagator, I think I could
almost re-use the delegatee as the allocated data. Otherwise, I just
have to construct the getter/setters that refer to the delegatee.

The 'compute-get-n-set is defined on <class>, so I'd probably have to
make my own <delegator-class>, which makes sense.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]