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,703c4f68db81387d X-Google-Thread: 109fba,703c4f68db81387d X-Google-Thread: 115aec,703c4f68db81387d X-Google-Thread: f43e6,703c4f68db81387d X-Google-Attributes: gid103376,gid109fba,gid115aec,gidf43e6,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!newsread.com!news-xfer.newsread.com!nntp.abs.net!attws2!att542!ip.att.net!newsfeed3.global.lmco.com!svlnews.lmms.lmco.com!not-for-mail From: "REH" Newsgroups: comp.lang.ada,comp.lang.c++,comp.realtime,comp.software-eng Subject: Re: [OT] Re: Teaching new tricks to an old dog (C++ -->Ada) Date: Fri, 11 Mar 2005 14:54:48 -0500 Organization: Earth Message-ID: References: <4229bad9$0$1019$afc38c87@news.optusnet.com.au> <1110032222.447846.167060@g14g2000cwa.googlegroups.com> <871xau9nlh.fsf@insalien.org> <3SjWd.103128$Vf.3969241@news000.worldonline.dk> <87r7iu85lf.fsf@insalien.org> <1110052142.832650@athnrd02> <42309456$1@news.broadpark.no> <1110569032.207770@athnrd02> NNTP-Posting-Host: 158.187.64.144 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Xref: g2news1.google.com comp.lang.ada:9165 comp.lang.c++:45211 comp.realtime:1304 comp.software-eng:4872 Date: 2005-03-11T14:54:48-05:00 List-Id: "Ioannis Vranos" wrote in message news:1110569032.207770@athnrd02... > Dr. Adrian Wrigley wrote: > > >>Ada features I would love to have in C++: > >>* "new types" and sub-ranges > > > I do not know what you mean exactly by that, however one can define his > own types rather than having everything as built-in. Ada allows you to define a primative type (int, etc.) that is "distinct" from others. This is nice for overload resolution, etc. > > > C++ provides general purpose facilities with which one can build his own > special purpose libraries, rather than providing special purpose > facilities as built in. I know, but being about to write "is new integer" is a lot simplier than creating a class just to create a "unique" integer type. Plus. since it is a unique type I can define its exact size in bits which make portabililty easier: type Byte is new integer range 0 .. 16#ff#; for Byte'size use 8; > > Vital! C++ and C suffer a lot from not enforcing encapsulation, > > allowing headers to break stuff etc. Better control of scope > > and visibility. Better separation of interface and implementation > > > May I assume that packages are a form of precompiled dynamic-link > libraries, like dlls in Windows? No, they are compilation construct (and can be define in a hierarchy). The are kind of like namespaces. If you ever used Borland's Turbo Pascal, they are like units. They make it easy to separate interface and implementation. Even inlines and generic bodys go in the body package, and not the specification package, and can be used in a library without needing the source present to be used. They also allow for the creation of an elaboration (static construction) order between packages to be defined.