[plt-scheme] re-open a bytes/string port?

From: YC (yinso.chen at gmail.com)
Date: Fri Jan 16 13:40:52 EST 2009

On Fri, Jan 16, 2009 at 5:53 AM, Matthew Flatt <mflatt at cs.utah.edu> wrote:

>
> There's no way to re-open the port. If the port is still open, you can
> rewind to the beginning by using the (badly named) `file-position'
> function.
>

I think I can probably get around this issue by creating my own port struct
to hold the bytes and the opened byte port for pass through.  Something
like:

(define-struct byte-port (bytes port) #:property prop:input-port 1)

Are there any issues (cost, synchronization, etc) with using port structs
this way that I need to think about?

Thanks,
yc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20090116/7467afb2/attachment.html>

Posted on the users mailing list.