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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,56250291936154a0 X-Google-Attributes: gid103376,public From: Robert A Duff Subject: Re: Where is the elusive jump command? Date: 2000/04/01 Message-ID: #1/1 X-Deja-AN: 605299249 Sender: bobduff@world.std.com (Robert A Duff) References: <38D771CA.D41AF9B5@port.ac.uk> <8bq7ku$mc8$1@nnrp1.deja.com> <38E0E723.C39C392@quadruscorp.com> <8brfm4$4uc$1@nnrp1.deja.com> <8brn4k$p6i$1@slb0.atl.mindspring.net> <8brrpj$i04$1@nnrp1.deja.com> <8c088m$puh$1@slb6.atl.mindspring.net> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 2000-04-01T00:00:00+00:00 List-Id: Richard D Riehle writes: > This could have been accomplished without the word _aliased_ > keyword. Could it have been as easily checked by the compiler? Yes, because as Robert pointed out, the same analysis has to be done for 'Address, anyway. > It seems to me that _aliased_ helps prevent the very kind of > errors one encounters in C. If the reserved word is not intended > to provide special information to the compiler, why not just do > this the same way we do it in C? Umm. Because the compiler isn't the one putting errors in the code -- it's you and me. "Aliased" is there for the human reader. It doesn't make the compiler any simpler. In fact the compiler has to go to extra trouble to check the rules. >...The fact is that I cannot use > 'Access on a value that is not aliased. The compiler prevents it. > Hence, I see this is as a signal to the compiler that I am trying > to do something illegal. It is also a tip-off to the compiler that > accessibility rules need to be enforced. Not really -- the accessibility rules are triggered by 'Access and type conversions and so forth; the compiler doesn't need any "tipping off" in this sense. > Whatever the original intent of _aliased_ , it has the effect of > letting the programmer know about the legality or illegality of a > syntactic construct, ensuring that certain practices are avoided, > and making it clear what one's intentions are in the source code. Right. >...Perhaps requiring the reserved word _aliased_ encourages the > sparing use of it in source code. I've heard that sort of thing many times. I don't agree. A competent programmer will use '[Unchecked_]Access on local variables exactly when appropriate -- no more, no less. That's true whether or not you have to mark things as "aliased". The point (IMHO) is not to encourage or discourage things, but to make sure the *reader* of the code can easily see what's going on. - Bob