Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion quest for pass-by-reference semantics in CL
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Bruce Hoult  
View profile  
 More options May 5 2002, 4:44 am
Newsgroups: comp.lang.lisp
From: Bruce Hoult <br...@hoult.org>
Date: Sun, 05 May 2002 20:44:08 +1200
Local: Sun, May 5 2002 4:44 am
Subject: Re: quest for pass-by-reference semantics in CL
In article <gat-0505020039060...@192.168.1.50>,
 g...@jpl.nasa.gov (Erann Gat) wrote:

> True, but it's not nearly as clear that a cons cell is not at all like a C
> struct.  In fact, to explain the behavior of passing a cons cell you have
> to hypothesize that you're really passing a pointer to the cons cell as
> the "value", but this hypothetical pointer is nowhere to be found in the
> language specification.  You have to invent it.  IMO that's no more
> reasonable than inventing a new term to describe what's going on.

The word "pointer" is perhaps not found in the language specification,
but if a C programmer just mentally substitutes the word "pointer" every
place it says "binding" then they'll understand it perfectly well.

In some ways a C++ reference is a better analogy, but in other ways
worse.  It is a better analogy, for example, in terms of the implicit
dereferencing, and also in that experienced C++ programmers know that
the compiler will often optomize away references (such as in calling
inline functions).  It is worse, in that assignment to a C++ reference
variable changes the contents of the value referred to, while asignment
in Lisp makes the binding point to a different value.

-- Bruce


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.