swarm-support
[Top][All Lists]
Advanced

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

Re: subclassing the Set object type


From: Wojtek Kopczuk
Subject: Re: subclassing the Set object type
Date: Thu, 12 Dec 1996 03:34:13 -0500

address@hidden (Bohdan Durnota) wrote:
> 
> A "simple" question:
> 
>         How can one (easily) subclass the Set object class? 
> Ideally, I would have thought that
>         #import <collections.h>
> 
>         @interface MySet : Set {
>         ... }
>         ...
>         @end
> 
> would have been sufficient, but this does not work.

You cannot. But you can define another class which contains
a Set object as an attribute and forward all of the messages
to this attribute:
@interface MySet : SwarmObject 
{ id set; ... }
-forward: (SEL) aSelector : (arglist_t) arguments;
...
@end

@implementation MySet
-forward: (SEL) aSelector : (arglist_t) arguments {
  return [ set performv: aSelector : arguments]; }
...
@end

Wojtek

-- 
-----------------------------------------------------------
Wojtek Kopczuk              "There is no third way between
address@hidden       right and wrong"
IGS: wojtek                  Friedrich von Hayek 
http://www.econ.lsa.umich.edu/~wojtek
-----------------------------------------------------------


reply via email to

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