Mon, 4 Sep 2000 06:08:11 -0700, Simon Marlow <[EMAIL PROTECTED]> pisze:

> So: a handle would either be no-encoding, in which case you can
> use hGetByte and friends, or it would have an encoding in which
> case you can use hGetChar and friends.

I assume that using a wrong version would throw an exeception.

If Handles are explicitly in text or binary state, it goes further:
seeking should be disabled for the text case. Not only file position
numbers don't mean anything, but it's impossible to even go back
to a previously visited position because of conversion buffering,
and it's also impossible in principle for stateful encodings.

Tying conversion to text/binary distinction should work for many
cases but invalidates the idea of transparent compression, where the
stream is physically binary, does have a conversion and logically may
be either text or binary (but will not follow local line terminator
convention unless we implement it ourselves, so maybe it did not fit
well anyway).

> Perhaps this is too much complication given that the underlying
> implementations are so similar, but it seems nice.

Some functions would have to be overloaded (not polymorphic).
Hopefully I will manage to just overload on Storable...

-- 
 __("<  Marcin Kowalczyk * [EMAIL PROTECTED] http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK


Reply via email to