[plt-scheme] contract questions

From: Jos Koot (jos.koot at telefonica.net)
Date: Thu Oct 16 11:50:14 EDT 2008

Hi

(define stream/c
 (promise/c
  (or/c
   null?
   (cons/c any/c stream/c))))

error: reference to an identifier before its definition: stream/c

(define stream/c
 (flat-rec-contract strm
  (promise/c null?)
  (promise/c (cons/c any/c strm))))

error: flat-rec-contract: expected flat contracts as arguments, got #<proj-contract>
I guess beacuse (promise/c expr) does not yield a flat contract.

Is what I want possible? If yes, how?

Thanks, Jos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20081016/20682621/attachment.html>

Posted on the users mailing list.