Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!usc!apple!snorkelwacker!husc6!spdcc!esegue!compilers-sender From: perelgut@turing.toronto.edu (Stephen Perelgut) Newsgroups: comp.compilers Subject: Re: Enumerated data types Keywords: C, Pascal, design, Turing Message-ID: <90Aug27.114846edt.1883@jarvis.csri.toronto.edu> Date: 24 Aug 90 14:29:30 GMT References: <1990Aug23.134826.2865@forwiss.uni-passau.de> Sender: compilers-sender@esegue.segue.boston.ma.us Reply-To: perelgut@turing.toronto.edu (Stephen Perelgut) Organization: CSRI, University of Toronto Lines: 14 Approved: compilers@esegue.segue.boston.ma.us The Turing Programming Language (developed at the University of Toronto and the subject of previous postings here) has an approach to the problem. type carColor : enum(red, blue, yellow, black) type bikeColor: enum(red, orange, yellow, green, blue) Thus succ(carColor.red) is carColor.blue and never bikeColor.orange. Similarly, ord(carColor.red) = ord(bikeColor.red) only co-incidentally and ord(carColor.blue) not= ord(bikColor.blue) If you want more information on Turing, try emailing "distrib@turing.toronto.edu" -- Send compilers articles to compilers@esegue.segue.boston.ma.us {ima | spdcc | world}!esegue. Meta-mail to compilers-request@esegue.