Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!mintaka!spdcc!esegue!compilers-sender From: kurt@tc.fluke.COM (Kurt Guntheroth) Newsgroups: comp.compilers Subject: Re: Enumerated data types Keywords: C, Ada, design Message-ID: <1990Aug29.160256.29820@tc.fluke.COM> Date: 29 Aug 90 16:02:56 GMT References: <1990Aug23.134826.2865@forwiss.uni-passau.de> Sender: compilers-sender@esegue.segue.boston.ma.us Reply-To: kurt@tc.fluke.COM (Kurt Guntheroth) Organization: John Fluke Mfg. Co., Inc., Everett, WA Lines: 18 Approved: compilers@esegue.segue.boston.ma.us Ada allows enumerated types whose member names are overloaded. You resolve the ambiguity by specifying the type in ambiguous situations. The syntax is '() in Ada (though I'm sure Ada uses different names for the metasymbols). car_colors is (red, blue, brown, black); bike_colors is (orange, red, green, white); . . . x := car_colors'(red); There was a certain amount of discussion of how this ought to be done in SIGPLAN Notices in 1981 or so, but I havn't bothered to go look them up. As I remember, the papers were mostly picking on Ada because it was very stylish to pick on Ada back then. Now it is stylish simply to ignore Ada. -- Send compilers articles to compilers@esegue.segue.boston.ma.us {ima | spdcc | world}!esegue. Meta-mail to compilers-request@esegue.