[m-dev.] io streams

David Overton dmo at hydra.cs.mu.oz.au
Tue Dec 28 00:17:28 AEDT 1999


On Mon, 27 Dec, 1999 at 11:27:49PM EST, Ralph Becket wrote:
> One thing that comes to mind is that there may be more efficient
> ways to implement read_chars than simply as a layer on top of
> read_char.  For example, if I want to read several bytes/chars
> from a Unix stream I would be inclined to use fread() rather than
> a loop over getchar().  This sort of optimisation can be vital in
> practice.

Perhaps this is one situation where default methods would be nice: the
default would define read_chars in terms of read_char, but individual
instances could redefine it if it is possible to write a more
efficient version.


David
-- 
David Overton       Department of Computer Science & Software Engineering
PhD Student         The University of Melbourne, Australia
+61 3 9344 9159     http://www.cs.mu.oz.au/~dmo
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list