From ... Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!ossa.telenet-ops.be!nmaster.kpnqwest.net!nreader2.kpnqwest.net.POSTED!not-for-mail Newsgroups: comp.lang.lisp Subject: Re: quest for pass-by-reference semantics in CL References: <2h6627rlr0.fsf@vserver.cs.uit.no> <2hsn5araqe.fsf@vserver.cs.uit.no> <3229347076995853@naggum.net> Mail-Copies-To: never From: Erik Naggum Message-ID: <3229526943281243@naggum.net> Organization: Naggum Software, Oslo, Norway Lines: 53 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 04 May 2002 18:49:04 GMT X-Complaints-To: newsmaster@KPNQwest.no X-Trace: nreader2.kpnqwest.net 1020538144 193.71.199.50 (Sat, 04 May 2002 20:49:04 MET DST) NNTP-Posting-Date: Sat, 04 May 2002 20:49:04 MET DST Xref: archiver1.google.com comp.lang.lisp:32831 * keke@ma.ccom (Takehiko Abe) | > > > PARAMETER PASSING IN LISP IS CALL-BY-VALUE. | > > | > > Whatever. but Harbison & Steele clearly indicates in the above | > > that call-by-value implies parameter copying. | > | > Indeed. | | That contradicts what you wrote earlier: | | > In C, pass-by-value implies that a copy is made of the value | > passed, | | Nonsense!! In C, as in Lisp, no copy is made. | | good night. Look, guys, am I the only one here with a computer science education? (Besides Matthias Blume, obviously.) I have no idea how people get so screwd up -- if I had, I would make a comet carreer in psychiatry from watching all the nutjobs on USENET for so many years -- but call by value or reference or name refers to the information passed from the caller to the callee about how the arguments (actual parameters) to a function were specified. Let me take the standard three, again: 1 Call by value -- no information is passed from the caller to the callee about the origin of the argument, only its value is available. So when the formal parameter is used, it refers to a local binding of that value. 2 Call by reference -- information is passed that makes the callee to reference the actual argument, to which the formal parameter refers, so when the formal parameter is used, it indirectly refers to the caller's binding of that value. 3 Call by name -- information is passed that makes the actual argument as it was specified in the call available to the caller, including any bindings that an expression closes over, such that using the formal argument (acts as if the system) evaluates the expression each time. This call-by-foo things is _so_ not about what the values of arguments might be. This is _only_ about how much the callee gets to know about the arguments it receives. I marvel at the lack of education or other exposure to these terms in the literature that could have produced such a horrible confusion. This is an extremely clear-cut differentiation of argument passing semantics that leaves no room for confusion. If you cannot access the _binding_ that was used as an actual argument in the callee, you do _not_ have call-by- reference semantics regardless of how much you may modify the contents of any composite object you are passed. -- In a fight against something, the fight has value, victory has none. In a fight for something, the fight is a loss, victory merely relief. 70 percent of American adults do not understand the scientific process.