[plt-dev] promises and srfi 41

From: Jos Koot (jos.koot at telefonica.net)
Date: Wed Nov 4 13:06:04 EST 2009


It has been some time ago (may be a year) that I adapted Phil Bewig's srfi 41 for PLT. You did not like me duplicating the code for promises. I don't like it either. However, in order to discriminate streams from other promises without duplication of promises.ss, I need a means to make a subtype of promises. The only thing I need for that is that the promise struct descriptor is exported from promise.ss and dependent modules (e.g. scheme scheme/base). Without the ability to make a subtype of promises it is not possible to implement function =stream?=. Without this function many argument checks become faulty. Would you be inclined to export the promise struct descriptor (or any other means for the definition of subtypes of promises) in mzscheme, scheme and scheme/base? As far as I can see, wrapping stream promises in another struct type poses problems to memory bound execution of examples that should be memory bound. I am not sure, but I assume that using a subtype does not imply an extra layer of dereference. This is crucial, of course.

With the aforementioned tool, I can simplify PLT's implementation of srfi 41 considerably. I also intend to expose stream-lazy to the user (which is much simpler than providing additional binding constructs (stream-lamdba, stream-let, etc) The binding constructs required by srfi 41 will be maintained, of course.

Hoping all is well with you and your family, Jos.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/dev/archive/attachments/20091104/215d1248/attachment.html>

Posted on the dev mailing list.