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, MSGID_RANDY 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 Dewar Subject: Re: Where is the elusive jump command? Date: 2000/03/29 Message-ID: <8brrpj$i04$1@nnrp1.deja.com>#1/1 X-Deja-AN: 603683069 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> X-Http-Proxy: 1.0 x42.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Wed Mar 29 03:03:23 2000 GMT X-MyDeja-Info: XMYDJUIDrobert_dewar Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.61 [en] (OS/2; I) Date: 2000-03-29T00:00:00+00:00 List-Id: In article <8brn4k$p6i$1@slb0.atl.mindspring.net>, Richard D Riehle wrote: > > To write such a compiler, it is necessary to include certain > reserved words and syntactic constructs that "tip off" the > compiler to possible problems. The word _aliased_ seems to me > to be one of those "tip-off the compiler" words. This can > later be augmented with a more technical explanation, but it > works well for most early students when explained within the > framework of the above stated goals. I find this a very odd view of the ALIASED keyword. The reason for this has nothing to do with the compiler. As in the case of most C compilers, the compiler could look at your code to see whether or not you take the address of something. That's not at all the intention. The point is that aliasing is generally speaking very bad practice. The facility for pointing to variables was introduced in Ada 95 with reluctance when certain convincing examples were given, including in particular the construction of static structures involving pointers. It should be VERY sparingly used, really it should be regarded like Unchecked_Conversion, a noisy declaration that you intend to do something rather undesirable, namely in this case the creation of possibly confusing aliases for the variable. Note by the way that 'Address can be applied freely to variables in any case without the ALIASED keyword, so Ada 95 compilers in any case have to have the circuitry for automatic detection of which variables have their addresses taken and which do not (GNAT most certainly has this circuit). Thus ALIASED is not of the slightest utility to the compiler (in GNAT it is essentially ignored except for providing the essential semantic checking associated with this facility). Sent via Deja.com http://www.deja.com/ Before you buy.