[comp.lang.modula2] Generic sets module. Anybody interested?

ricki@john.informatik.rwth-aachen.de (Richard Breuer) (06/25/91)

During the last two years of Modula-2 programming I managed to create
a module called SETs which implements the concept of mathematical sets
in Modula-2. This means that sets may contain an arbitary number of elements
(just limited by the target machines heap).

Besides this SETs has the ability to store elements of arbitary Modula-2
data type (that's what I call 'generic'). All you have to do is to declare
a (so called) 'set class' for the data type you want to keep sets for.
This implies the restriction that one set may only contain elements of
one static data type. There are of course predefined set classes for all
the Modula-2 standard data type like CARDINAL, INTEGER, CHAR. So you may
use these type without any further 'work'.

So if there is some general interest in this module (please drop me a mail),
I will post it to this news group.

PS: There are currently three versions available. PLEASE SPECIFY THE ONE
    YOU ARE INTERESTED IN (just write 1,2, or 3):

    (1) for the m2c compiler on SUN/3 and SUN/4 (unix)
    (2) for the Fitted Modula-2 compiler on PCs (tested on 286)
    (3) for the Taylor Modula-2 compiler on PCs (tested on 286)

    Each version comes with german/english comments and with/without 
    runtime error checking.

warwick@cs.uq.oz.au (Warwick Allison) (06/26/91)

(Richard Breuer) writes:

>During the last two years of Modula-2 programming I managed to create
>a module called SETs which implements the concept of mathematical sets
>in Modula-2. This means that sets may contain an arbitary number of elements
>(just limited by the target machines heap).

I've done one to that implements SET OF CARDINAL or ARRAY CARDINAL OF BOOLEAN.
It stores elements in (From,To) pairs, and is intended for arrays exhibiting
a high degree of clumping.

I'm not going to suggest you ask for a copy.  What I would prefer to see is
a "comp.sources.modula-2" newsgroup (though this isn't an official call for
discussion/ voting etc.).

I think that provided we used VERY standard Modula-2, we could produce
an excellent library of sources.  In particular, the group would be useful
for such things as these mathematical abstractions we have mentioned.

Feel free to call for discussion, because I would even know how.


Warwick.
--
  _-_|\       warwick@cs.uq.oz.au
 /     *  <-- Computer Science Department,
 \_.-._/      University of Queensland,
      v       Brisbane, AUSTRALIA.