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,8371c11095eebd6e X-Google-Attributes: gid103376,public From: Robert Dewar Subject: Re: Ask for Access operator Date: 2000/05/07 Message-ID: <8f4rig$cbg$1@nnrp1.deja.com>#1/1 X-Deja-AN: 620431279 References: <06284168.a35ad676@usw-ex0109-068.remarq.com> X-Http-Proxy: 1.0 x34.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Sun May 07 22:43:30 2000 GMT X-MyDeja-Info: XMYDJUIDrobert_dewar Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.61 [en] (OS/2; I) Date: 2000-05-07T00:00:00+00:00 List-Id: In article , "Pete" wrote: > if you are using ada95 try this > > type Int_Ptr is access all Integer; > Data : aliased Integer := 5; > I_Ptr : Int_Prt; > I_Ptr := Data'Access Oh dear! Ted's answer was just spot on here, and I wondered to him off line if someone would post an answer like the above. This is almost CERTAINLY wrong advice. It almost CERTAINLY leads to writing junk C-in-Ada style code. There are very few cases in which it is legitimately appropriate to use aliased variables and the Access operator. When you need these features they are valuable, but they are also very dangerous because they encourage a nasty low level style of coding that is quite familiar to C programmers, but quite inappropriate in Ada. If you are going to learn Ada, you want to learn how to write Ada in Ada style. If you want to write C, you might as well write in C :-) I must say that I see huge overuse of 'Access and aliased in a lot of Ada95 code. Sent via Deja.com http://www.deja.com/ Before you buy.