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=0.7 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!watmath!clyde!att!rutgers!gatech!hubcap!billwolf From: billwolf@hubcap.clemson.edu (William Thomas Wolfe,2847,) Newsgroups: comp.lang.ada Subject: Re: Reference Semantics Message-ID: <3739@hubcap.UUCP> Date: 5 Dec 88 12:31:34 GMT References: <10322@umn-cs.CS.UMN.EDU> Sender: news@hubcap.UUCP Reply-To: billwolf@hubcap.clemson.edu List-Id: >From article <10322@umn-cs.CS.UMN.EDU>, by stachour@umn-cs.CS.UMN.EDU (Paul Stachour): > I'm for reference semantics. They are natural, efficient, and > don't force this explicit-pointer "junk". But let's make sure > what we can do with them in today's environment before we ask > Ada 9X to mandate them. OK, we're sold on the benefits of reference semantics. Let's assume that "in out" parameters are always passed by reference. Now why should it be impossible for the programmer to choose pass-by-value, as in "in" and "out" modes? (BTW, a good compiler could eliminate the copy in many cases by proving to itself that there is no attempt to modify the "in" parameter and therefore just passing it by reference anyway. Such compiler analysis is necessary because programmers frequently want to use "in" mode just to assure the procedure's users that the parameter will not be modified. But sometimes the local copy is modified, and the copy then becomes something that would have had to be done anyway. To force an explicit copy would then reduce program readability.)