From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b0d68c502c0ae6 X-Google-Attributes: gid103376,public From: fraser@synopsys.com.com Subject: Re: Printing Enum Variable Re: Linux World Date: 1999/03/03 Message-ID: <920499183.209.20@news.remarQ.com>#1/1 X-Deja-AN: 450917426 References: <7bfc2n$jl9@dfw-ixnews5.ix.netcom.com> <36DCAC1F.430E2C5E@aasaa.ofe.org> <7bk4v8$kl8$1@remarQ.com> <36DDA761.7B4E8099@aasaa.ofe.org> X-Complaints-To: newsabuse@remarQ.com X-Trace: 920499183.209.20 KZBGBQC4S164892E1C usenet1.supernews.com Organization: Vegetarian Ada Programmers NNTP-Posting-Date: Wed, 03 Mar 1999 22:13:03 GMT Newsgroups: comp.lang.ada Originator: fraser@titanic Date: 1999-03-03T00:00:00+00:00 List-Id: I nearly cried when dstarner98@aasaa.ofe.org said: >I never meant this as an attack on Ada. It just that complaining about C >for lack of enumeration strings is as appropriate as complaining about >Ada for lack of a "?:" operator. It's not that big a deal. Believe me, I'd have to kill myself if I got narky whenever someone said that a feature in Ada is not necessarily positive. But you're still wrong :) I see the enumeration string thing itself as being minor. However, consider what being able to provide that feature means: enumerations are actual, real live types just as, say, integers are. Having an Image attribute is a big flag that says an enumeration is something more than just a convenience; it says that the language supports it, nutures it, and holds it when it cries. I think that your comment about a similar operation in C being inconsistent with the semantics of an enum in that language is telling: it shows that they're not really there. They're just window dressing. Attributes indicate a lot about the type system. For an array object X, being able to write X'Range, X'First, X'Last etc. tells you that Ada has a lot of support for what arrays actually are. The fact that these things are not available in C (not even X'First in the general case [1]) tells you how C feels about the construct. It doesn't have arrays, it has chunks of memory that you can allocate in a single declaration. Big whoop. This is, of course, completely informal. But a programming language is more than just a reference manual, it's a style as well. Oh, and sorry for the purpleness of the above. Fraser. [1] there's a C idiom that goes char a[100]; char *b = a-1; which gives you an array b from 1 to 100. Sure, it violates the standard, but name a compiler that rejects and I'll give you twelve zorkmids.