On Fri, 2004-04-23 at 21:44, Jonathan Lang wrote:

> OK: I'm planning on creating a widget which must not make use of any of
> the indicator functionality of the HList; I don't just want to not use the
> functionality - I want to have its use forbidden (letting the optimizer go
> ahead and toss out the indicator role).  So I'd like to create a subtype
> of HList which exceises that functionality.

I think you're thinking of this backwards.

Don't subclass HList.  Create a new class that doesn't subclass anything
and compose the appropriate roles into it.

Provided the library designers have done their job and *ask for the
proper role in function and method signatures, not a specific class*,
you're groovy.

Now I could be wrong about your intent, but the question "How do I
subclass a class to *remove* functionality?" is the kind of "Yeah, it
hurts when you do that" situation role-based composition try to avoid. 
If you have all of the pieces, put them together in a way you find most
pleasing.

-- c

Reply via email to