Browse thread
[Caml-list] [ANN] The Missing Library
-
John Goerzen
-
Kenneth Knowles
- Alexander V. Voinov
-
John Goerzen
-
Maxence Guesdon
-
John Goerzen
- Maxence Guesdon
-
John Goerzen
-
Alain.Frisch@e...
-
John Goerzen
-
Alain.Frisch@e...
-
Nicolas Cannasse
-
Yamagata Yoriyuki
- Gerd Stolpmann
-
Nicolas Cannasse
-
Yamagata Yoriyuki
- Jacques GARRIGUE
- Nicolas Cannasse
-
Yamagata Yoriyuki
-
Yamagata Yoriyuki
-
Nicolas Cannasse
- oliver@f...
-
Alain.Frisch@e...
-
John Goerzen
- Henri DF
- Shawn Wagner
- james woodyatt
-
Alain.Frisch@e...
- Basile STARYNKEVITCH
-
John Goerzen
- Kenneth Knowles
- Florian Hars
-
Maxence Guesdon
- Eric C. Cooper
-
Kenneth Knowles
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Benjamin Geer <ben@s...> |
| Subject: | Re: [Caml-list] Re: Common IO structure |
John Goerzen wrote: > On Thu, Apr 29, 2004 at 04:10:46PM +0100, Benjamin Geer wrote: > >>This is why I'm pleading for a layered API, so that character encoding, >>buffering, compression, encryption, and any other optional processing > > But you do not need a Java-esque API to do that. All you need is a > standardized File object. You could instantiate one of these by opening > a file. Or perhaps by passing an existing object to the initializer for > a gzip decompressor or a Unicode processor. The key for me is that I need to be able to chain processing steps together, so that I can, for example, decompress gzip format and convert the result to Unicode, a few bytes at a time. This suggests to me that the gzip compressor and the Unicode processor should themselves be implementations of the standard File object, so I can wrap a gzip decompressor around an underlying data source, then wrap the Unicode decoder around the gzip decompressor. The advantage of this approach is that the Unicode decoder doesn't know it's dealing with a gzip decompressor; it only knows it's dealing with something it can read bytes from. I can then easily remove the decompression step if needed. And that brings us back to a Java-like approach. If you can think of a better way of accomplishing this, I'd love to see it. Ben ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners