|[5 earlier articles]|
|Re: Enumerated data types email@example.com (1990-08-27)|
|Re: Enumerated data types firstname.lastname@example.org (1990-08-24)|
|Re: Enumerated data types email@example.com (1990-08-27)|
|Re: Enumerated data types grover@brahmand.Eng.Sun.COM (1990-08-28)|
|Re: Enumerated data types corbett@lupa.Eng.Sun.COM (1990-08-29)|
|Re: Enumerated data types firstname.lastname@example.org (Pete Jinks) (1990-08-29)|
|Re: Enumerated data types email@example.com.COM (1990-08-29)|
|Re: Enumerated data types firstname.lastname@example.org (1990-08-29)|
|From:||email@example.com.COM (Kurt Guntheroth)|
|Keywords:||C, Ada, design|
|Organization:||John Fluke Mfg. Co., Inc., Everett, WA|
|Date:||Wed, 29 Aug 90 16:02:56 GMT|
Ada allows enumerated types whose member names are overloaded. You resolve
the ambiguity by specifying the type in ambiguous situations. The syntax
is <type_specifier>'(<expression>) 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.
Return to the
Search the comp.compilers archives again.