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,LOTS_OF_MONEY autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,36bf044dcba542cc X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-09-29 08:09:21 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newshub2.rdc1.sfba.home.com!news.home.com!news1.sttln1.wa.home.com.POSTED!not-for-mail From: "DuckE" Newsgroups: comp.lang.ada References: <3BB56747.D60CA49F@acm.org> Subject: Re: Question on using protected objects X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Message-ID: Date: Sat, 29 Sep 2001 15:09:20 GMT NNTP-Posting-Host: 24.248.45.203 X-Complaints-To: abuse@home.net X-Trace: news1.sttln1.wa.home.com 1001776160 24.248.45.203 (Sat, 29 Sep 2001 08:09:20 PDT) NNTP-Posting-Date: Sat, 29 Sep 2001 08:09:20 PDT Organization: Excite@Home - The Leader in Broadband http://home.com/faster Xref: archiver1.google.com comp.lang.ada:13513 Date: 2001-09-29T15:09:20+00:00 List-Id: "Jeff Creem" wrote in message news:GMkt7.44297$vq.9196633@typhoon.ne.mediaone.net... > > "DuckE" wrote in message > news:C9jt7.52545$QK.35535895@news1.sttln1.wa.home.com... > > "Jeffrey Carter" wrote in message > > news:3BB56747.D60CA49F@acm.org... > > > What does your compiler say? (Hint: I suggest using GNAT with the -gnaty > > > option.) > > > > The compiler is perfectly happy with this. It even "appears" to do exactly > > what I want. If I were programming in C, that's as far as I would go before > > using this construct. In Ada I try to avoid the "try it and see if it > > works" mode of operation since it sometimes leads to unpredictable > results. > > > That is the strangest statement I ever heard. To summarize ... If you were using > a language where the compiler checks less at compile time and is less able to > tell you at run time about problems you are ?MORE? inclined to stop after a clean > compile and a run that appears to work? > My experience in C is that things are often not well defined. When I try something in C, I don't expect that if it works in my test it will work the same for different compilers. In Ada my expectations are higher. In Ada I expect that if I "play by the rules" my source code will work across multiple compilers on multiple targets. Just because some code is accepted by one compiler, it doesn't mean it will be accepted by all compilers. In Ada (as well as in most other programming languages), if you give the compiler correct source code it will give you correct executables. If you give the compiler bad source code the result is undefined. In my experience Ada catches many more problems in source code at compile time than other languages, but in some cases you can still generate an executable from bad code. For example bad source code might print a string that has not been initialized. The results depend on many factors. SteveD