swarm-support
[Top][All Lists]
Advanced

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

Re: Example of sets and indexing


From: Marcus G. Daniels
Subject: Re: Example of sets and indexing
Date: 24 Jul 1999 19:08:41 -0700
User-agent: Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.4

>>>>> "PJ" == Paul E Johnson <address@hidden> writes:

PJ> I'm a bit confused because I got the idea from someone in this
PJ> list that we were discouraging the use of the ordered set class,
PJ> instead recommending people just use list.  The Swarmdocs say as
PJ> much, I think, in the writeup of ordered set.

OrderedSet is a thin veneer on List w/ setIndexFromMemberLoc:.  Since
the implementation isn't much more than that, and doesn't actually
completely implement KeyedCollection as you might expect, I'd say
use the lower-level interface directly; it seems more honest.
Alternatively, use a Map with the key and member being the same.

PJ> Oh, one other question.  In your example, you create integers,
PJ> cast them as type id and add them to the set.

The MAKEINTEGER macro creates an instance of a local `Integer' class.
This more portable than casting `int' to an object because `int' and
`id' won't necessarily be the same size on all platforms.  Also, in
alternative language layers for Swarm (e.g. Java), it may not be
feasible to use primitive types in object contexts at all.


                  ==================================
   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.



reply via email to

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