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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,a9b0810d3106d9b8 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,CP1252 Path: g2news1.google.com!news3.google.com!feeder.news-service.com!feeder.erje.net!news2.arglkargh.de!news.karotte.org!uucp.gnuu.de!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Thu, 21 Apr 2011 20:58:15 +0200 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Fun with C References: <27cf3992-4132-4483-9110-adc7a089cd4a@e8g2000vbz.googlegroups.com> <54108d8d-4e7c-4901-bd5e-819d27720d48@a11g2000pro.googlegroups.com> <4daa8fc6$0$7652$9b4e6d93@newsspool1.arcor-online.net> <37428a21-61b4-4cdf-9897-7b84252f8fce@a11g2000pro.googlegroups.com> <4dab6906$0$6893$9b4e6d93@newsspool2.arcor-online.net> <57a1fa4b-4730-41a8-be8a-82061ef9dc22@x37g2000prb.googlegroups.com> <4daca6ba$0$6773$9b4e6d93@newsspool3.arcor-online.net> <33973ba6-c390-4af1-9116-6facb12e2878@u12g2000vbf.googlegroups.com> <4dad9c1b$0$6875$9b4e6d93@newsspool2.arcor-online.net> <0ee0dce3-9121-4af2-9c54-cd15264969ff@t19g2000prd.googlegroups.com> In-Reply-To: <0ee0dce3-9121-4af2-9c54-cd15264969ff@t19g2000prd.googlegroups.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Message-ID: <4db07e47$0$6771$9b4e6d93@newsspool3.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 21 Apr 2011 20:58:15 CEST NNTP-Posting-Host: c6e62177.newsspool3.arcor-online.net X-Trace: DXC=;4nR`FQKCdem7>ihJR;B_cMcF=Q^Z^V3h4Fo<]lROoRa8kFejVhe[0_KkfSTLd53b^BlQ`PDm X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:18957 Date: 2011-04-21T20:58:15+02:00 List-Id: On 4/21/11 4:52 PM, Elias Salom�o Helou Neto wrote: > You've quoted those which make sense. But what about "Arrays whose > indices do not have to begin at zero"? While it is a workaround and I > don't actually recommend it, in C you can simply declare an array with > a size slightly (+1) larger and use it as it started at 1. Another instance of the *but you can roll it* argument ;-). Certainly true, and creative, but misses one thing IMHO. The index type of an Ada array induces the compiler to test for correct index values. Similarly, the compiler will complain when a case distinction does not exactly cover the whole set of values in a type. Change the set of values in a type and watch the Ada compiler tell you which dependent declarations will now be incorrect, or where a case value isn't handled by a case statement. Suppose you could do the following in C. I trust that C programmers would find this really cool: #include enum Color {Red, Green, Blue}; typedef uint8_t rgb_intensity; int main(void) { rgb_intensity things[enum Color]; // This Here return 0; } a = http://itunes.apple.com/de/album/this-here/id218299914?i=218299916 listen(a[0]); A := http://itunes.apple.com/de/album/this-here/id218299914?i=218299916 Listen(To => A(A'First));