Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!decvax!mcnc!ecsvax!dgary From: dgary@ecsvax.UUCP Newsgroups: net.lang Subject: Re: (Re:)* Modula-2, exceptions, C Message-ID: <2871@ecsvax.UUCP> Date: Mon, 9-Jul-84 17:07:32 EDT Article-I.D.: ecsvax.2871 Posted: Mon Jul 9 17:07:32 1984 Date-Received: Wed, 11-Jul-84 03:39:18 EDT References: yale-com.4096 Lines: 20 >From: leichter@yale-comix.UUCP (Jerry Leichter) Fri Jun 29 10:48:05 1984 >... there IS a valid argument to be made that requiring an & at the point >of call has the salutory effect that it is possible to determine BY LOOKING AT >THE CALLING CODE ONLY, what values may potentially be affected by the call. >Think about it: In C the ONLY things that can directly change the value of >a variable are =, op=, ++, and --, and the only thing that can cause a value >to be change indirectly is &. Actually, arrays are effectively passed by reference in C, since what is value-copied is a constant pointer. A stylistic device (making the first letter of an array name capital?) could serve to make this clear, perhaps. Nevertheless, your point is a good one. In Pascal, only the subroutine shows whether values are passed by reference or by value. In PL/I and FORTRAN only the caller determines this. In C it is usually clear from looking at either what is being passed. D Gary Grady Duke University Computation Center, Durham, NC 27706 (919) 684-4146 USENET: {decvax,ihnp4,akgua,etc.}!mcnc!ecsvax!dgary