Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site reed.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!vax135!cornell!uw-beaver!tektronix!reed!bart From: bart@reed.UUCP (Bart Massey) Newsgroups: net.lang.mod2 Subject: Re: Re: large SETs desired Message-ID: <1982@reed.UUCP> Date: Tue, 8-Oct-85 14:40:49 EDT Article-I.D.: reed.1982 Posted: Tue Oct 8 14:40:49 1985 Date-Received: Sat, 12-Oct-85 13:24:21 EDT References: <43@noscvax.UUCP> <12107@rochester.UUCP> Distribution: net Organization: Reed College, Portland, Oregon Lines: 37 > In the posting of the reference, the problem of supporting reasonably > large sets is considered. The other referenced poster says that he thinks set ops should be extrinsic to the language, and so should strings. I don't think I buy it for M2, for the simple reason of code legibility. For sets as a mathematical construct, like numeric expressions (another place where "a lot of tradeoffs are made"), OPERATORS, and not functions, are desirable as the atomic elements for manipulation of the object. One of the reasons it isn't very much fun to write mathematical functions in LISP, but is in APL, is that an APL function is symbolically much like what you would write on paper, whereas LISP functions bear no obvious symbolic relation to the equation they represent. And M2 of course does not allow you to define operators. In Algol68 it might make sense to make sets extrinsic. But note also that fixed size sets have a straightforward and highly efficient internal representation on most machines. It seems reasonable to make the compiler generate code to deal with this representation, instead of using more inefficient user code to do it, since set ops are often so useful. I think that this is also a good argument for adding intrinsic ops to the language to implement strings, as well as stacks, queues, and other commonly used data structures. Of course, the tradeoff is, as always, compiler complexity... As per the size of the sets, it seems reasonable to insist that compilers support sets of (bits/byte)*(largest value that fits in a WORD) elements. This is enough to support any reasonable use, and is still efficient to index... Wouldn't it be nice to be able to write the Sieve of Eratosthenes just like you think it? Bart Massey ...tektronix!reed!bart