[racket] streams and promises

From: Jos Koot (jos.koot at gmail.com)
Date: Tue Apr 1 14:29:56 EDT 2014

Something went wrong with my previous email. Sorry. I try again.
 
Hi.
First of all congratulations with version 6.0. Very mice indeed.
The streams as provided by racket/stream are very nice and much simpler than
in srfi 41.
two remarks though.
 
one.
racket/stream duplicates code as found in racket/promise too.
This is necesssary, of course, for otherwise we could not discern streams
from promises.
It would be nice if racket/promise would provide a tool for the definition
of subtypes of promises.
Such a tool would have to define (at least) a predicate (procedure) and two
constructors (syntaxes), one for lazy and one for delay.
 
two
I miss something that I call stream-lazy.
When using racket/stream, I define:
(define-syntax-rule (stream-lazy def/expr ...)
 (stream-cdr (stream-cons 'who-cares? (let () def/expr ...))))
When using srfi 41, I define:
(define-syntax-rule (stream-lazy def/expr ...)
 ((stream-lambda () def/expr ...)))
 
Just my two cents.
Jos
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140401/05b67425/attachment.html>

Posted on the users mailing list.