Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site sjuvax.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!allegra!sjuvax!jss
From: jss@sjuvax.UUCP (J. Shapiro)
Newsgroups: net.lang.c
Subject: places where sets are useful
Message-ID: <907@sjuvax.UUCP>
Date: Tue, 26-Feb-85 02:14:27 EST
Article-I.D.: sjuvax.907
Posted: Tue Feb 26 02:14:27 1985
Date-Received: Tue, 5-Mar-85 14:08:46 EST
References: <10983@watmath.UUCP> <21000020@uiucuxc.UUCP>
Organization: Saint Josephs Univ. Phila., Pa.
Lines: 28

[Pacman's revenge...]

	It seems to me that in compiler writing, the case where one has
multiple transitions on a single input character is an ideal case for sets.
This is of course only an intermediate stage, so perhaps it does not
justify a full blown set type.

	A better example is one of modal software, where one's modes are
defined by a set of their names... For you pascalions:

type
	mymodes = (insert, error, append, ...);
var
	status = set of mymodes;

begin
...
if (status * [insert, append]) <> [] then begin....
...
end
...
end.

Is much more readable and therefore less likely to get mangled in software
rewrites then is the exhaustive "if" phrasing.


Jon Shapiro