[r6rs-discuss] Laziness Features - reentrancy

Eli Barzilay eli at barzilay.org
Thu Oct 19 21:07:16 EDT 2006


On Oct 18, AndrevanTonder wrote:
> On Mon, 16 Oct 2006, Eli Barzilay wrote:
> 
> > I was surprised to see that the bullets at the end of section 20.3
> > were kept.
> 
> I don't know if the existing bullets should be kept.

Just to clarify things: I don't think that I oppose having these
bullets in, I just don't think that they're the kind of stuff that can
be thrown in as a side remark.  I think that my Lazy Scheme
implementation is a natural result of taking these bullets to an
extreme -- which means that I *like* them, but I think that they lead
to something that is different enough from a `plain' Scheme that it
requires more discussion.  In its current form, I think that they are
questionable.


> However, I would like to suggest a bullet option allowing
> implementations to throw an exception for reentrant promises,
> reading as follows:
> 
>    - An implementation may raise a runtime contract violation if a
>      promise refers to its own value, i.e., if forcing a promise may
>      cause the promise to be forced a second time before the value
>      of the first force has been computed.
> 
> In other words, the example in the middle of page 121 may be allowed
> to throw a runtime exception.
> 
> I think being able to detect this kind of thing is a useful feature,
> and an implementation should not be disallowed from providing this
> feature.  I have an implementation that does this, if someone is
> interested.
> 
> I might make this a formal comment.  However, I'll wait and see
> first - maybe someone knows of useful applications of reentrant
> promises of which I am not aware.

It sounds to me like a probably useful feature, but I wouldn't bet on
not having any use for the kind of self-reference that will be
forbidden by it.  I will try to do this in my Lazy Scheme thing, and
see if any problems pop up.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!



More information about the r6rs-discuss mailing list