Subject: Re: Summary: Thoughts on implementing Scheme in C
From: rpw3@rigden.engr.sgi.com (Rob Warnock)
Date: 15 Nov 2000 02:09:14 GMT
Newsgroups: comp.lang.scheme
Message-ID: <8usr8a$fl73c$1@fido.engr.sgi.com>
Matthias Blume  <see@my.sig> wrote:
+---------------
| rpw3@rigden.engr.sgi.com (Rob Warnock) writes:
| > +---------------
| > | Ordinary linked closures (= SICP's "environment model") are not
| > | safe-for-space...
| > +---------------
| > 
| > This is not obvious to me -- could you say more?  Since the environment
| > of the current closure is abandoned when making a tail call, I fail to
| > see the necessity of space-unsafety in the simple linked model.
| 
| As I explained in another article, I was referring to Appel's notion
| of "safe-for-space" here -- which is stronger than the requirement of
| proper tail-call optimization.
+---------------

Having just re-read section 1.5 "Closure Representation" and Chapter 12
"Space Complexity" in Appel's book (and a couple of papers of his), I now
understand that. Sorry for the confusion. I was hearing "not safe for space"
as meaning (or at least implying) "not safe for tail-calls".

I think for me (really an "engineer", despite my ancient math degree)
it comes down to whether you're viewing it from the "provably safe,
can't *possibly* hurt yourself" viewpoint, or the "can be used safely
with proper training" school. ;-}

+---------------
| > Though note that closures contain their environments, and portions
| > of those captured environments *can* be mutable!
| 
| Not in standard Scheme.  If you view the environment as a mapping from
| names to _locations_ (i.e., NOT the values stored in those locations),
| then even a set! of a variable will not modify the environment
| (because the mapping does not change).
+---------------

Again, sloppy language on my part, perhaps. Note that I said "portions"
of those captured environments, by which I really meant boxes (ref cells),
pairs, vectors, & strings.

+---------------
| This is like having an (immutable) record of (mutable) ref cells in
| ML: you can store into the ref cells, but you can't mutate the record.
+---------------

We are actually in violent agreement, I think, except where I use
langauge that isn't precisely the standard terms in the literature
(and for which I apologize).


-Rob

-----
Rob Warnock, 31-2-510		rpw3@sgi.com
Network Engineering		http://reality.sgi.com/rpw3/
Silicon Graphics, Inc.		Phone: 650-933-1673
1600 Amphitheatre Pkwy.		PP-ASEL-IA
Mountain View, CA  94043