Subject: Re: R5RS vs. "In Scheme, everything is a pointer"
From: (Rob Warnock)
Date: 14 Sep 2001 04:22:51 GMT
Newsgroups: comp.lang.scheme
Message-ID: <9ns0mr$j0eg3$>
In article <>,
Bill Richter  <> wrote:
>Barry M responds to Matthias B:
>   >No, as far as I can see, this discussion has been about locations
>   >belonging to CONS cells which are pairs of abstract locations.
>   In that case, R5RS specifically says "record structure".  To anyone
>   with any computer programming background, that simply means a
>   contiguous block of memory containing the components of the
>   structure, as in the C structure declaration
>   struct cons {
>     cell_t car;
>     cell_t cdr;
>   };
>Congratulations, Barry!  This is the 1st time one of my "opponents"
>made a substantive comment about R5RS, afaik.
>And your point has some merit.  I realized myself that "record
>structure" might be like struct, but it didn't occur to me that the
>whole struct would be stored and not just the two members.  That was
>dumb of me.
>But let's keep going, I want a serious discussion about R5RS.  
>Would you agree there's no real evidence for your point of view other
>than this C meaning of "record structure"?  I'm saying that evaluating
>a cons allocates two locations X & Y, called the car & cdr field.  And
>you seem to be saying that evaluating a cons allocates three
>locations: X & Y & L, and the pair (X,Y) is stored in L.  Is that
>right?  Is that what you think the obvious interp of R5RS is?
>I grant you that your "record structure" argument is evidence for this
>point of view.   But I can't find any other evidence.  Can you?
>Here's what I consider to be strong evidence against it:   The
>Denotational Semantics in sec 7.2 says that pairs is 
>L x L x T
>that's two locations and an mutability flag.    I think you want 
>L x L x L x T
>I think that's evidence against you.   On the other hand, I'm
>certainly no expert on the DS in sec 7.2.
>Let me do a little agreeing with you:
>   procedure:  (cons obj1 obj2)
>   Returns a newly allocated pair whose car is obj1 and whose cdr is
>   obj2.  
>Note that it's just the pair that's newly allocated.  I think I was
>reading that as 
>"returns a pair with newly allocated car & cdr fields, whose car ...".
>So this subsection isn't evidence for my point of view.
>   Also, by focusing specifically on "locations belonging to CONS
>   cells", you forget that the language deals with values in general.
>   A value has to act the same whether you got it from the value of a
>   variable, a cell of a cons cell, or an element of a vector.  R5RS
>   specifically says that Scheme passes by value, not reference, so
>   the location where it came from is irrelevant.
>Sure, sounds good.  I'm not sure how this fits into the discussion.
>But I do think that focusing too much on cons is a mistake, because we
>can emulate cons as a procedure.  So I think (eventually) that it's
>more fruitful to talk about "everything is a pointer" in regards to
>procedures & environments.  But I'd like to finish this cons
>discussion, for personal/historical reasons.