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 Wed, Apr 28, 2004 at 12:35:26AM +0100, Benjamin Geer wrote: > >>In Java there are two I/O libraries, the original one (java.io)[1] and >>the new one (java.nio)[2]. The old one has the virtue of being easy to >>understand and use, and flexible enough for many situations. The basic > > Uh, no. I don't have the API reference in front of me, I provided links to it in the very message you're replying to. > but I seem to > recall somewhere around a dozen or so predefined classes for doing > I/O... I've been using java.io every day for several years, and I find those classes simple and intuitive, particularly the layered approach of using wrappers to add functionality to stream objects, as Nicholas Cannasse points out in another message. However, I agree that there are too many classes in java.nio; I'm pretty sure something simpler can be done in Caml using its more powerful polymorphism. > Python is simple. One standard for everything. You get read(), > write(), readline(), readlines(), xreadlines() (hello Extlib, this one's > for you), seek(), etc. This can apply to files, strings, sockets, > pipes, whatever. Before we can start fussing about unicode > abstractions, I think we need to have a uniform I/O layer. OK, but then you can leave out readline(), readlines() and xreadlines(), because they don't make any sense unless you've already dealt with character encodings. Then, before you can divide text into lines, you also need to know which newline character(s) to use. This needs to be configurable programmatically rather than guessed based on the platform the program is running on; some protocols require you to use \r\n regardless of the platform. 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