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,782af4edeb84c4b7 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns13feed!worldnet.att.net!attbi_s71.POSTED!53ab2750!not-for-mail From: "Jeffrey R. Carter" Organization: jrcarter at acm dot org User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: basic basic ada question References: <1161268231.345231.242170@m73g2000cwd.googlegroups.com> <1qy643kz9ktss$.12j6z88wjcte2$.dlg@40tude.net> <1161272720.704725.208180@e3g2000cwe.googlegroups.com> <6WQZg.1028379$084.76409@attbi_s22> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 12.201.97.213 X-Complaints-To: abuse@mchsi.com X-Trace: attbi_s71 1161321005 12.201.97.213 (Fri, 20 Oct 2006 05:10:05 GMT) NNTP-Posting-Date: Fri, 20 Oct 2006 05:10:05 GMT Date: Fri, 20 Oct 2006 05:10:05 GMT Xref: g2news2.google.com comp.lang.ada:7059 Date: 2006-10-20T05:10:05+00:00 List-Id: Robert A Duff wrote: > > Why should one think in C or Ada? There are lots of concepts that > transcend the languages. After all, both languages have subroutines, > parameter passing, stack/heap allocation, etc, etc. The Ada mindset is essentially the same as the SW engineering mindset. > Well, actually, the first argument is numbered 1 in C, too. ;-) > argv[0] is what Ada calls Command_Name -- not one of the arguments. To C, it's one of the arguments (the 1st, so naturally it's numbered 0). Ada realizes that it's not. It's the command that the arguments are arguments to. > Dijkstra wrote an interesting paper called "Why numbering should start > at zero", which you can find via google. I don't buy it -- I like to > number most things starting at 1, despite his fairly reasonable > arguments to the contrary. I've seen it, and I don't buy it, either. My experience is that fewer mistakes are made when the numbering from the domain is used. Some of his arguments, such as ease of calculating the length of a sequence, are things that the language should do for you. There should be 'Length for discrete subtypes; it returns the number of values in the subtype. > It's interesting that for enumeration types, T'Pos starts numbering > at 0. Yes. They're not Pos-itions, they're offsets. Positions should start at 1. If they did, then T'Base'First could be 0. That might be useful in some cases. -- Jeff Carter "I fart in your general direction." Monty Python & the Holy Grail 05