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,2dcd952b915f15c1,start X-Google-Attributes: gid103376,public From: "W. Wesley Groleau (Wes)" Subject: Lang. Design Query (no practical value) Date: 1996/08/15 Message-ID: <9608151648.AA07688@most>#1/1 X-Deja-AN: 174860130 sender: Ada programming language comments: To: info-ada%listserv.nodak.edu@emcee.com mailer: Elm [revision: 70.85] newsgroups: comp.lang.ada Date: 1996-08-15T00:00:00+00:00 List-Id: The answer to this question will make no practical difference, but I'm still curious. I am trying to track down cases of abuse of access types and heap space. I use a run-time call to get a stack trace, and then I start from the top and work down looking for local variables that contain pointers but are not cleaned up (Ada 83--no auto-finalize). Since I didn't write the code, I have to go to other files to check parameter modes when the items in question are used for actuals. I suppose the writer knew when he/she wrote the call what the modes were, and had some idea of what the call would do with the actuals. Yet sometimes stuff both in and out of the call makes me wonder. (Like putting a non-null pointer on an out parameter, or assigning null to the parameter within the call.) More often than not, neither the formals nor the actuals were named in a way that would provide a clue. What do some of you experienced multi-language folks think would have been the advantages or disadvantages of the following "alternate Ada" ? procedure Do_Something ( This_Thing : in This_Type; That_Thing : out That_Type; Other_Thing : in out Other_Type ); Hypothetical call: A_Package.Do_Something ( This_Thing => Voici, That_Thing <= Voila, Other_Thing <=> Aussi ); where the choice of [which kind of] arrow must match the parameter mode. The writer of the call would not be able to avoid knowing the mode--but is that necessarily a Good Thing? The comparison operator would be "overloaded" but the context would make it safe for the compiler, except when 'That_Thing' just happens to be a local object, and a "<=" just happens to be defined to return the expected type, and positional association is used. Impossible in this case--can't have That_Thing positional if This_Thing isn't. But possible in the following foolish code: ... Formal : Boolean; Actual : Boolean; begin if "not" (Formal <= Actual) then ... Anyway, the answer(s) won't change anything, but if things get slow on comp.lang.ada and you don't have any work to do...... --------------------------------------------------------------------------- W. Wesley Groleau (Wes) Office: 219-429-4923 Hughes Defense Communications (MS 10-40) Home: 219-471-7206 Fort Wayne, IN 46808 (Unix): wwgrol@pseserv3.fw.hac.com ---------------------------------------------------------------------------