Re: sets for sequence.e?

new topic     » goto parent     » topic index » view thread      » older message » newer message

Jules wrote:
> 
> First I'd like to say thanks to Jeremy for all his hard work on the standard
> library. If there is room for a few more functions, I find the following
> useful,
> and believe others would too. I suggest they would fit better in sequence.e
> rather than math.e. They are quite general and IMHO are not really "math"
> functions.
> 
> The first one is a type.
> 
> set ==> ensures that the variable is a sequence wherein
> 
> each of its members only occurs once in the sequence
> 
> union ==>         s = union (s, s)
> 
> returns the union of two given sets
> 
> 
> intersection ==>  s = intersection (s, s)
> 
> returns the intersection of two given sets
> 
> 
> diff ==>          s = diff (s, s)
> 
> returns the difference of the two given sets; i.e.,
> 
> the inverse of the union (with the intersection removed)
> 
> 
> is_subset ==>     i = is_subset (s, s)
> 
> returns T (1) if the first set is a subset of the second
> 
> 
> is_superset ==>   i = is_superset (s, s)
> 
> returns T (1) if the first set is a superset of the 2nd
> 
> These are all from Rod Jackson's "set.e". But I suggest one more (not included
> in his library):
> 
> mk-set ==>  s = mk_set(s)
> returns a sequence with duplicate elements removed, so
> each of its members occurs only once in the sequence.

There is also
http://oedoc.free.fr/Fichiers/ESL/sets.zip

It's quite more complete, as it handles maps between sets and composition laws.
It was laid out and documented for inclusion in the ESL framework. But, if there
is interest, I can edit the ESL stuff out.

CChris

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu