[racket] make-limited-input-port and Port Events

From: Milo Arvidsson (miloarvidsson at hotmail.co.uk)
Date: Sat Jun 11 21:55:38 EDT 2011

I'm getting contract violations when I use 'make-limited-input-port' with port events.
For example, this program:

#lang racket/base
(require racket/port)
(define in (open-input-string "12345\n"))
(sync (read-line-evt (make-limited-input-port in 512)))
fails like this:
contract violation: expected <input-port-with-progress-evts?>, given: #<input-port:string>
  contract on read-line-evt from
 (file C:\Program Files\Racket\collects\mzlib\port.rkt)
  blaming
 (file d:\example.rkt)
  contract:
 (case->
 (-> input-port-with-progress-evts? evt?)
 (->
 input-port-with-progress-evts?
 line-mode-symbol?
 evt?))
at: <collects>/mzlib\port.rkt:1811.2

So, I guess the port returned by 'make-limited-input-port' does not provide progress events: 

#lang racket/base
(require racket/port)
(port-provides-progress-evts? (make-limited-input-port (open-input-string "12345\n") 512))

that program returns #f ... I'm using Racket v5.1.1 on Windows. 		 	   		  


Posted on the users mailing list.