[m-rev.] for review: improve I/O implementation for erlang backend

Peter Wang wangp at students.csse.unimelb.edu.au
Fri Jun 22 14:39:18 AEST 2007


On 2007-06-22, Peter Ross <pro at missioncriticalit.com> wrote:
> On Thu, Jun 21, 2007 at 05:45:52PM +1000, Peter Wang wrote:
> > Estimated hours taken: 6
> > Branches: main
> > 
> > Improve the Erlang I/O implementation.
> > 

> > +    ;
> > +        {From, write_char, Char} ->
> > +            From ! {self(), write_char_ack},
> > +            % XXX use file:write with raw streams
> > +
> > +            io:put_chars(IoDevice, [Char]),
> > +            LineNr = LineNr0 + one_if_nl(Char),
> > +            mercury_file_server(IoDevice, LineNr, PutBack0)
> 
> I don't understand how this code handles the write failing (eg file
> system full)

It doesn't yet.  The io:put* functions don't appear to return error
codes, but file:write functions does.  I have added XXXs for later.

> > +mercury_putback(Stream, Character) ->
> > +    {'ML_stream', _Id, Pid} = Stream,
> > +    Pid ! {self(), putback, Character},
> > +    receive
> > +        {Pid, putback_ack} ->
> > +            void
> > +    end.
> > +
> Add an explaination of why you do the ack,
> and you don't actually return any data.

Fixed.

Peter
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list