[r6rs-discuss] [Formal] Improve port i/o.

From: Shiro Kawai <shiro>
Date: Fri Nov 24 05:00:53 2006

From: Michael Sperber <sperber_at_informatik.uni-tuebingen.de>
Subject: Re: [r6rs-discuss] [Formal] Improve port i/o.
Date: Fri, 24 Nov 2006 06:38:56 +0100

> OK. So how about MIME?

Once I tried parsing MIME switching text and binary mode,
but it became really messy. I end up using layered ports:
The bottom layer reads MIME as byte stream, and passes
them through to the upper layer, except it watches the stream
and recognizes MIME boundaries. For each MIME body a new
upper-layer port is created. The user reads from the upper-
layer port, which returns EOF when the bottom layer reads
a MIME boundary. By this, MIME reading part can be agnostic
to the body's encoding, whether it is a binary or a text, etc.
It seems cleaner to me, but if there's a clever way to avoid
layering I'm curious to know.

--shiro
Received on Fri Nov 24 2006 - 05:00:48 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:00 UTC