Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!caip!lll-crg!gymble!umcp-cs!cvl!umd5!zben From: zben@umd5.UUCP (Ben Cranston) Newsgroups: net.lang.c Subject: Re: Swap by name Message-ID: <1065@umd5.UUCP> Date: Mon, 7-Jul-86 18:37:23 EDT Article-I.D.: umd5.1065 Posted: Mon Jul 7 18:37:23 1986 Date-Received: Wed, 9-Jul-86 02:09:14 EDT References: <1964@brl-smoke.ARPA> <1060@umd5.UUCP> <2293@umcp-cs.UUCP> Reply-To: zben@umd5.UUCP (Ben Cranston) Organization: U of Md, CSC, College Park, Md Lines: 26 Summary: OOPS In article <1964@brl-smoke.ARPA> rbj@icst-cmr.ARPA (Root Boy Jim) writes: > I was thinking of the caller squirrelling away the value in a temporary > location, passing it by reference (thus allowing modification by the > callee) and then copying the result to the real variable. In article <1060@umd5.UUCP> zben@umd5.UUCP (Ben Cranston) replies: > Of course the difference between this and real call-by-name comes when > the subroutine has an alternate access to the global in question - perhaps > because of scoping rules, or access to a pointer-to-it or something. In article <2293@umcp-cs.UUCP> chris@maryland.UUCP (Chris Torek) cautions: > Careful, Ben: this was under a section about call by value-result, > and it does accomplish that quite handily. Er, yeah. Another difference between call-by-name and value-result comes when the actual is subscripted like a[i] and different array indices can be selected on each reference to the formal (assuming i modified). This would have been a better example than the one I actually gave. No criticism of you or Root Boy was meant, I was only adding information. Your point that I should have reviewed the entire discussion before posting is well taken. -- umd5.UUCP <= {seismo!umcp-cs,ihnp4!rlgvax}!cvl!umd5!zben Ben Cranston zben @ umd2.UMD.EDU Kingdom of Merryland Sperrows 1100/92 umd2.BITNET "via HASP with RSCS"