From ... Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newshunter!cosy.sbg.ac.at!news.netway.at!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> <3229526943281243@naggum.net> <4y9ez9x3o.fsf@beta.franz.com> Mail-Copies-To: never From: Erik Naggum Message-ID: <3229595011915709@naggum.net> Organization: Naggum Software, Oslo, Norway Lines: 51 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 05 May 2002 13:43:32 GMT X-Complaints-To: newsmaster@KPNQwest.no X-Trace: nreader2.kpnqwest.net 1020606212 193.71.199.50 (Sun, 05 May 2002 15:43:32 MET DST) NNTP-Posting-Date: Sun, 05 May 2002 15:43:32 MET DST Xref: archiver1.google.com comp.lang.lisp:32887 * Duane Rettig | The problem with the terms call-by-value/pass-by-value is not that | they are not well-defined. The problem is that these terms are | confusing because people don't understand what a "value" is. I believe it is entirely clear in the context of all three conventions. I also think there is a difference between call _by_ value/reference and call _with_ value/reference that is somehow conflated here. That is, somehow, people confuse what the argument _is_ and _how_ it is passed. | Values are different things in different languages. In C, a struct is a | value but an array is not. In Lisp, neither structs nor arrays are | values. Because of these different definitions of "value", confusion | creeps in. This is a classic case of equivocation. Just because there are different kinds of values and references in the language, does not mean that the _same_ meaning of "value" and "reference" exists in a technical term that relates to the relationship between actual and formal parameter in a call. | If such a description does exist, then it would be useful for a Lisp FAQ | entry such as "Is Lisp pass-by-value, pass-by-reference, or | pass-by-name?" could be answered, (e.g. "pass-by-value, with appropriate | understanding of what a value is") along with that appropriate definition | of what a Lisp Value is. I answered Frode with what I think is a fresh start. Let me repeat it here in case it got lost: Argument passing in Common Lisp is conceptually equivalent to building a list of the results of evaluating each of the argument forms to the function and passing that list to the function, which conceptually unpacks it into the formal parameters. All knowledge of the source of the values is lost by that time. The conceptual equivalence to a list is used to lay the ground for apply, &rest, &key, etc, and also neatly captures the order of evaluation so an explanation of this rule will fall out naturally from the description. | Also, a link could be made to the C definitions for Value, for contrast. But it has nothing to do with what a _value_ is. This has to do with whether you pass whatever-a-value-is or wherever-whatever-is-a-value-is whenever you pass an argument to a function. (Call it the Shakira theory. :) -- 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.