C typedef deficiency

mat at hou5e.UUCP mat at hou5e.UUCP
Fri Jun 24 11:46:30 AEST 1983


Well, regarding the enum's ... I don't think that there would be much, if
any efficieny difference over, say, #defines.  They are, if well implemented
in a language, one more good way to aid communication and make strong typing
available to the programmer when she thinks that it is needed.  Ada has some
good ideas here ... the disambiguate in the case of
(hope this is close to being right .. I DON'T use enum's)

typedef enum
(
	RED,
	GREEN,
	ROTTEN
)	APPLES;

typedef enum
(
	FLORIDA,
	CALIFORNIA,
	ROTTEN
)	ORANGES;

one would write APPLES.ROTTEN or ORANGES.ROTTEN.

ADA (Yes, a TM of US DOD, et&c) has a LOT of good ideas.  Also a few very
bad ones, and in critical places.  And a lot of other problems (which
should get discusssed in net.lang).  One area that received a lot of
attention (ie nitpicking from academia) was disambiguation in various forms.
If there is a successor to C I hope that its designers use the good stuff out
of ADA, just as (it seems) C used good stuff from the FORTRAN/PL\/1 heritage.

I don't think enums, as implemented, are either well enough designed or
well enough implemented to be integrated into one's standard repertoire
of C constructs and techniques.

(My opinions only ... they should not be construed to represent opinions
of either my employer or client)

					Mark Terribile
					(sometime Duke of deNet)
					Spiridellis & Associates
					(A member of the Cap Gemini Sogetti
						USA Group)
					On contract at American Bell, Holmdel
					hou5e!mat



More information about the Comp.lang.c mailing list