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,FREEMAIL_FROM, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e4e9809bdf82397f X-Google-Attributes: gid103376,public From: "Nick Roberts" Subject: Re: Newbie Access Types Date: 1999/08/25 Message-ID: <37c45ac7@eeyore.callnetuk.com>#1/1 X-Deja-AN: 517177418 References: <7pe6tg$dqq$1@dailyplanet.wam.umd.edu> X-Original-NNTP-Posting-Host: da133d90.dialup.callnetuk.com X-Trace: 25 Aug 1999 22:06:15 GMT, da133d90.dialup.callnetuk.com X-MSMail-Priority: Normal X-Priority: 3 Newsgroups: comp.lang.ada X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Date: 1999-08-25T00:00:00+00:00 List-Id: You are correct about a formal out parameter of an access type being initialised from the value of the actual, as per RM 6.4.5(13). I believe the reason you suggest is or was the reason for this rule. It has always seemed to me that an equally satisfactory rule (or allowable option) would be for the formal to be initialised to null, especially when Access_Check is in effect (or, if not, where it is known the hardware traps an attempt to dereference a null access value, and this trap can be handled as an exception). However, it also seems to me that it could be quite cogently argued that such an initialisation is folly, in that there is no reason why the subprogram failing to set the value of the parameter (to something logically sensible in the prevailing context) should not cause the program to come crashing disastrously down anyway. (And the language allows worse things to happen anyway, such as when an abort divides an operation to do with access values.) I would not, myself, subscribe to such an argument, since I (and, I imagine, others) would hold that, in practice, there will be many situations where such an initialisation will save a problem turning into a crisis. I should imagine that the initialisation could be eliminated by an optimiser under certain circumstances, but (as I'm sure Robert Dewar would be quick to point out) it may well be that this optimisation would never be worthwhile in practice (too complicated for the small benefit). ------------------------------------- Nick Roberts http://www.adapower.com/lab/adaos ------------------------------------- Ronald Ayoub wrote in message news:7pe6tg$dqq$1@dailyplanet.wam.umd.edu... | I have read that an access type parameter is always copied in even when | the parameter is an out parameter and that this is so that the access type | is not undefined which can cause problem. Could someone please elaborate | on this? It is my thought that access types are initialized to null when | not explicitly initialized so that an uncopied access type going into a | function will only result in the formal parameter being initialized to null. | Maybe I'm being picky but I like to learn things thoroughly.