[Circle-dev] ObjectProxy
Paul LeoNerd Evans
leonerd at leonerd.org.uk
Fri Nov 20 19:31:14 GMT 2009
On Fri, Nov 20, 2009 at 06:58:28PM +0000, Paul LeoNerd Evans wrote:
> > (Apply the attached bundle (via 'hg unbundle') to
> > http://hg.atheme.org/users/aerdan/tangence-python/ and I think you'll
> > see what precisely I'm getting at here.)
>
> I'll take a look....
OK, having taken a look I'm now even more convinced that's not really a
good idea :)
However, I will take the point that we are missing some more types of
operations on these things, and we do have a certain amount of code
duplication between ARRAY and QUEUE.
To this end, I propose something of the following:
Rename the internal details of ARRAY to VECTOR - a vector is a
generalised idea that maps integers into somethings. Implement all the
possible operations on this. Noting also that many of them collapse to
others, can probably simplify this quite a bit; e.g.
insert_start(values) =>
insert(0,values) =>
splice(0,0,values)
Next, we define three actual types to be used as real property
dimensions. ARRAY and QUEUE you've already seen, and why not add a STACK
largely for completeness. These can all share the same internal
implementation, differing only in the sets of operations the server
objects will allow, and the client objectproxies will expect their
embedding to provide. These are:
ARRAY QUEUE STACK
insert_start yes
insert yes
insert_end yes yes yes
remove_start yes yes
remove yes
remove_end yes yes
splice yes
move yes
This structure also potentially leaves the way open to creating other
specific subsets of operations which may be useful on certain vector
types.
--
Paul "LeoNerd" Evans
leonerd at leonerd.org.uk
ICQ# 4135350 | Registered Linux# 179460
http://www.leonerd.org.uk/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: Digital signature
URL: <http://mail.leonerd.org.uk/pipermail/circle-dev/attachments/20091120/d054894f/attachment.pgp>
More information about the Circle-dev
mailing list