[m-rev.] New library module: pile
Fergus Henderson
fjh at cs.mu.OZ.AU
Thu Feb 6 03:15:10 AEDT 2003
On 05-Feb-2003, Ralph Becket <rafe at cs.mu.OZ.AU> wrote:
> Fergus Henderson, Wednesday, 5 February 2003:
> > On 05-Feb-2003, Ralph Becket <rafe at cs.mu.OZ.AU> wrote:
> > > Added a new library module, pile, for a collection type supporting O(1)
> > > insertion and concatenation.
> >
> > Does this type represent a set, a multiset, or a sequence?
> > Looking at the code, I see that it represents a sequence.
> > The documentation should make that clear.
>
> Done.
>
> > This data type looks quite similar to the `cord' data type
> > defined in the Boehm collector (see boehm_gc/include/cord.h),
> > except that it is generalized to allow the sequence to contain
> > elements of any type, rather than just `char'.
>
> Hmm. Do you think `cord' might be a better choice of name?
Well, "cord" is by analogy with "string" --
I've also seen the name "rope" used for the same thing.
(For small jobs, string usually is fine,
but for big jobs, you may need a rope ;-)
But because strings are so strongly associated with
*character* strings, these names are not so good for a more
generalized sequence type.
I don't think "pile" is a good name, though, because to me
"pile" suggests a rather unordered data type, i.e. one representing
sets or multisets rather than sequences.
Hmm, there must be something similar in Edison...
<googles away for a few minutes>
Yes, the Edison Haskell library has a data type named "JoinList"
which I think is probably essentially the same thing as your
"pile" type. The name "JoinList" (or "join_list", as it would
be in Mercury) is IMHO not bad -- it quickly gets across both the idea
that the type is a kind of list (i.e. that it represents a sequence) and
the idea that the type is good for joining (i.e. concatentation is cheap).
Still, I'm open to alternative suggestions...
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list