[m-dev.] for review: stream I/O

Ralph Becket rbeck at microsoft.com
Tue Oct 3 02:21:03 AEDT 2000


>From Peter Ross on 02/10/2000 15:59:44
> However putback characters and line numbers are implemented at the C
> level not at the Mercury level. This functionality is common to all
> streams so it should be implemented at the Mercury level.

No no no!  This functionality is not common to all streams.  It's nice
to have it on some input streams.  If a stream implementation doesn't
supply putback_char//1 then use the stream wrapper type I posted a few
messages ago.

> I ported the Mission Critical lowlevel C solution to this problem and it
> slows down the code by a factor of three for cat.m

I'm not sure I understand.  Did you implement putback_char//1 in C and
get a slowdown or did you use a wrapper supplying putback_char//1 and
get a slowdown?  If it's the latter case, then I'm not surprised:
default and/or wrapper implementations should be expected to be more 
costly than `native' implementations.  If it's the former then I'm very
surprised since it should be no different than what we have in io.m now,
so I'd be interested to learn what was causing the problem.

Cheers,

Ralph

--
Ralph Becket      |      MSR Cambridge      |      rbeck at microsoft.com 

--------------------------------------------------------------------------
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