Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utcs!mnetor!seismo!rochester!sher From: sher@rochester.UUCP Newsgroups: net.lang Subject: Re: Proc types Message-ID: <19401@rochester.ARPA> Date: Mon, 14-Jul-86 14:03:17 EDT Article-I.D.: rocheste.19401 Posted: Mon Jul 14 14:03:17 1986 Date-Received: Mon, 14-Jul-86 22:35:08 EDT References: <800016@ccvaxa> Reply-To: sher@rochester.UUCP (David Sher) Organization: U of Rochester, CS Dept, Rochester, NY Lines: 35 Keywords: Enumerated types This is in response to an article that requested an ability to have types that pointed to a particular set of proceedures. I would think an even more useful artifact would be a type constructor that took a set of elements of a particular type and had a type that only allowed those elements. Many languages now allow such for integers. Thus Now we have type constructors of the form: array [a..b] of type record of { t1 , t2 , t3 ... } function from { t1 , t2 , t3 ...} to type and variants thereof with various protections such as classes and what not. I suggest another type constructor: enumeration from type of { e1 , e2 , e3 ...} where ei is an element of type. Thus you could have the pascal like enumeration from int of { 1 , 5 , 7 , 12 } or interestingly enumeration from char * of { "GOOD" , "BAD" , "INDIFFERENT" } or enumeration from real of { 1.34273 , 123408.24398 , 23408 } or enumeration from int * ( int * x ) of { qsort , slowsort , merge } Does any language have such a feature. I think the semantics should be non controversial. The implementation however may cause some problem. -David -- -David Sher sher@rochester seismo!rochester!sher