[plt-scheme] srfi 41 for PLT

From: Jos Koot (jos.koot at telefonica.net)
Date: Fri Feb 15 17:39:49 EST 2008

Download my PLT implementation of Phil Bewig's SRFI-41 form the following link.


At Phil's request, the code has been modified as little as possible.
The included tests, leak tests included, run well on DrScheme, version [3m].
Documentation is included in msword (doc) and html format (without having been touched by me) 
Docs have not yet been scribled (I am not much of a scribbler, I'm afraid)

Especially for Matthew Flatt:
Thanks for fixing  http://bugs.plt-scheme.org/query/?cmd=view&pr=8963.

Especially for Eli Barzilay
Initially I thought native PLT promises could be used.
Nevertheless the code includes its own code for van Tonder promises (SRFI 45)
For two reasons:

1:    there is still a problem with the van Tonder promises as now implemented in PLT Scheme.

2:    streams must be a distinct type, for they must not be confused with promises as delivered by syntaxes delay and lazy.
Otherwise we would get in trouble with something like: (stream 1 (delay 1) (lazy (delay 1)))
There is no such thing as 'make-promise-type'.
An alternative would be to wrap PLT's promises in a struct-type, but I find this extra layer not attractive.
As they are now, the streams are already slow enough.
The implementation of the van Tonder promises is as simple as possible (in fact copied from SRFI 45)

I suggested to Phil Bewig several ways of improving the performance, some of which he copied.
However, with respect to many other suggestions Phil Bewig asked me with some force to keep as close to his code as possible. So I did.

When PLT R6RS arrives, it will be little work to adapt the code or may be just copy the R6RS version as already prepared by Phil Bewig.

Of course I am available in case of problems, bugs, questions, and so on.
I am sure the same holds for Phil Bewig.

Kind regards,
Jos Koot

(define-syntax expose-stream-lazy (syntax-rules ( ) ((_ expr) ((stream-lambda ( ) expr)))))  ;)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20080215/0dec9c88/attachment.html>

Posted on the users mailing list.