[r6rs-discuss] Laziness Features - reentrancy

AndrevanTonder andre at het.brown.edu
Wed Oct 18 14:23:22 EDT 2006


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.  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.

Andre






More information about the r6rs-discuss mailing list