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> Mail-Copies-To: never From: Erik Naggum Message-ID: <3229347076995853@naggum.net> Organization: Naggum Software, Oslo, Norway Lines: 39 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 02 May 2002 16:51:17 GMT X-Complaints-To: newsmaster@KPNQwest.no X-Trace: nreader2.kpnqwest.net 1020358277 193.71.199.50 (Thu, 02 May 2002 18:51:17 MET DST) NNTP-Posting-Date: Thu, 02 May 2002 18:51:17 MET DST Xref: archiver1.google.com comp.lang.lisp:32624 * Frode Vatvedt Fjeld | Aren't you just redefining the meaning of pass-by-value here? Is there | any system that isn't pass-by-value under your definition? Look, this is getting annoying. The reference that is intended in the term pass-by-reference is not the value of the variable (storage cell), it is the variable (storage cell) itself. This has been the established meaning of these terms basically forever. You are seriously confused if you think pointers as such constitute references. There are three very, very common ways to pass arguments to functions: 1 Pass by value: The value of the variable (storage cell) is extracted by the caller and passed to the callee. This also means that all arguments to a function are just values and a function call can just evaluate all arguments in order and pass the values to the callee. This is precisely what Common Lisp specifies. 2 Pass by reference: The variable (storage cell) is passed to the callee, which can read or write to it. This means that you cannot call a function with the value of another function call without storing it in a variable. Fortran has _traditionally_ been pass-by-reference. Ada has out parameters. C++ has references (coincidence? not!). 3 Pass by name: The expression itself is passed to the callee, which will re-evaluate it with the values of subexpressions captured in the call. (They actually pass closures much like I and Joe and Pierre offered with the setter/reference macro.) This is what Algol and Simula can do. This is (or should have been) CS 101 material. Please just learn it and avoid confusing others who might have no education at all and are likely to listen to bogosities. Having to clean up after such confusions is both annoying and wasteful when you could have avoided the "information pollution" in the first place. -- 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.