[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Can you explain again about how to use new collections classes along
From: |
Marcus G. Daniels |
Subject: |
Re: Can you explain again about how to use new collections classes along side Swarm collections? |
Date: |
20 Oct 2000 16:32:59 -0700 |
User-agent: |
Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.4 |
>>>>> "PJ" == Paul E Johnson <address@hidden> writes:
PJ> I run into the problem of name space clashes between my methods
PJ> that use the same names as collections in the Swarm collections,
PJ> methods like "getCount" "getFirst". One side-effect of the gcc in
PJ> RH7 seems to be more harrassment about duplication of methods.
PJ> Maybe I just never noticed them before, but I don't think so.
The only harrassment I would expect would be if -getCount, etc. had
a different return type.
PJ> I have found that one way to solve this problem is to explicitly
PJ> type (or declare Protocol of) every collection created, except
PJ> this cramps my style in a few places where I want a method to
PJ> receive any of the swarm collections, not a particular one.
Protocols are a good way to go here, i.e. something like
@interface MyCollection: CreateDrop <Collection, [etc]>
implementing all the stuff that you need. Subclassing is possible to,
but then you need to create mycollection.[hm] module files. In the
mycollection.m file, the crucial magic is to associate the
implementation class with the `type' object, which is derived from the
protocol file. The easiest way to do this would probably be to copy
tests/activity and start ripping out all the particulars program
names, replacing them with your own.
==================================
Swarm-Support is for discussion of the technical details of the day
to day usage of Swarm. For list administration needs (esp.
[un]subscribing), please send a message to <address@hidden>
with "help" in the body of the message.