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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,971aa11c293c3db1 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-07-20 10:47:50 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!nntp.cs.ubc.ca!newsfeed.direct.ca!look.ca!news1.tor.metronet.ca!nnrp1.tor.metronet.ca!not-for-mail Message-ID: <3B586EC3.9C494668@home.com> From: "Warren W. Gay VE3WWG" X-Mailer: Mozilla 4.75 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada The Best Language? References: <3B59CD72@MailAndNews.com> <3B5573DA.5ABA8EA7@earthlink.net> <9j94gj$1uk6$1@norfair.nerim.net> <3B581E6B.6FB1DAEF@earthlink.net> <9j9cip$238u$1@norfair.nerim.net> <9j9grk$6na$1@nh.pace.co.uk> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Fri, 20 Jul 2001 17:47:49 GMT NNTP-Posting-Host: 198.96.47.195 NNTP-Posting-Date: Fri, 20 Jul 2001 11:47:49 MDT Organization: MetroNet Communications Group Inc. Xref: archiver1.google.com comp.lang.ada:10363 Date: 2001-07-20T17:47:49+00:00 List-Id: Marin David Condic wrote: > Some attributes in Ada can be overriden - where it makes sense. However, one > of the things I know of no way of doing in C++ are things where I want the > compiler to track ranges, etc., of subtypes and use the attributes to make > sure everything works based on what the compiler knows. What you are > referring to as "traits" sounds like nothing more than implementing > functions (or macros?) to return characteristics of complex types - not > getting the compiler to figure things out for you and track all that info so > you don't have to. > > If you look at the really rich collection of attributes that Ada provides > for objects, types, subprograms, tasks, etc., I think you will see that > these can be extremely useful in all sorts of ways. They can aid in > portability, or isolate the impact of changes or provide all sorts of useful > information about the data and code you are using that helps develop more > flexible & adaptable applications. In further support of Ada.. This is where a C/C++ programmer might use a macro (or clumsy sizeof expression) to describe the extent of an array bound. The Ada compiler OTOH readily provides the programmer with the array'Length attribute. There is never a disagreement with the array length and the attribute, as there can be with the C macro when it does not apply to the array (or you have redefined the macro). Additionally, sizeof can be misleading in certain uses, because it's returned size may be the physical size, rather than the actual size etc. Furthermore, Ada does not force arrays to start at zero. This is fully supported with array'First and array'Last (with array'Length providing the difference). C/C++ cannot come close in comparison at these points. This allows you as the programmer to not be force to think in implementation terms -- you subscript the array as appropriate to your application. > Check out Annex K of the ARM (on-line available at > http://www.adapower.org/ - look under "Reference" and "On-line version of > the Ada 95 Reference Manual at AdaPower.com ") You will find a wealth of > things available to you that are not paralleled in C++ or any number of > other languages. I particularly like them for mathematical computations! > > MDC > -- > Marin David Condic > Senior Software Engineer > Pace Micro Technology Americas www.pacemicro.com > Enabling the digital revolution > e-Mail: marin.condic@pacemicro.com > Web: http://www.mcondic.com/ -- Warren W. Gay VE3WWG http://members.home.net/ve3wwg