[m-dev.] for review: use bitsets in quantification

Simon Taylor stayl at cs.mu.OZ.AU
Sat Nov 11 02:22:28 AEDT 2000


Fergus wrote:
> On 10-Nov-2000, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> > 
> > Fergus wrote:
> > > OK, I'll give up on `..` for now, and go back to just wanting to be
> > > able to support a dense_bitset type.  For that type, I need `first'
> > > and `last' methods.  I guess it doesn't strictly *need* contiguous
> > > to_int values, though.
> > 
> > I think it's better to leave the `enum' class as it is for now,
> > rather than add stuff which may or may not be useful later.
> > We can add a `bounded_enum' class derived from `enum'
> > for the `enum_first' and `enum_last' methods.

> I'm happy with the design, but I object to the use of the name `enum'.
> That name should be reserved for something that is actually enumerable, IMHO.

Just to explain why I'm keen on this use of `enum':
An enumerable set is a set for which there is a one-to-one mapping
onto a subset of the integers. What Fergus is suggesting should
be denoted by `enum' is the proper subset of the enumerable sets for
which the range of the mapping is a contiguous set of integers.
It seems to me to be a bit confusing to use (an abbreviation of) the
name of a set to describe a proper subset of that set.

That said, if the consensus is to change `enum' to `reversible_hash' in
the sparse_bitset changes, I'm happy to do that.

By the way, I think my handling of the instance `enum(bool)' is wrong --
`from_int/1' should fail for everything other than 0 and 1.

Simon.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list