Re: feature request from r5rs

Matthias Radestock <[email protected]>
Newsgroups gmane.comp.java.sisc.devel
Message-ID <[email protected]>
Narang wrote:
> From r5rs: * Some implementations may implement ``implicit forcing,''
> where the value of a promise is forced by primitive procedures like
> cdr and +:
> 
> (+ (delay (* 3 7)) 13)          ===>  34
> 
> 
> Can this feature be added to sisc? thoughts.

It wouldn't be hard to add, with three caveats:

* preventing it from slowing down *everything* is difficult,

* synchronization is required in order to implement the correct 
semantics in the presence of multiple threads,

* care needs to be taken to ensure the correct call/cc semantics is 
implemented.

R5RS doesn't say anything explictly about the last point. However, it is 
clear from the examples that capturing a k inside a delayed expression 
and subsequently invoking it will

* (partially) re-evaluate the delayed expression and re-set the memoized 
value,

* resume computation at the point where the force (explicit or implicit) 
occured.


Matthias.



-------------------------------------------------------
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.