[m-dev.] for review: add Mission Critical extensions

Simon Taylor stayl at cs.mu.OZ.AU
Sun Jul 9 16:59:36 AEST 2000


 
> > > runtime/mercury_library_types.h:
> > >     If MISCRIT_STREAMS is defined use the Mission Critical version of
> > >     the type MercuryFile.  The new definition of MercuryFile makes it
> > >     possible for Mercury to handle streams connected to sockets and
> > >     pipes under WinNT.  The MercuryFile structure now contains pointers
> > >     to functions to do the basic operations on streams, which allows
> > >     them to be changed according to the type of stream.
> > >     All this extra functionality is then hidden behind macros,
> > >     allowing the original definition of MercuryFile to coexist.
> > 
> > Isn't this useful for users other than Mission Critical?
> > 
> However sockets and streams are read/write which means that input and
> output streams need to be equivalent.  This is a change to the interface
> of the io library, and may lead to less type safe code.

This was addressed in Fergus' review of Paul Massey's changes
(the original review is in the mercury-developers archive for February 1998).
The only problem with not exporting the equivalence of io__input_stream
and io__output_stream was that we needed multiple identical versions
of some predicates to convert between file descriptors and the
various types of streams.

Given that we already have `io__close_output', `io__close_input',
`io__close_binary_input' and `io__close_binary_output' (all with
the same implementation) I don't see what is the problem with doing
the same for the `fd_to_stream' and `stream_to_fd' predicates.
It's not ideal, but it's better than not having socket support.
It's _much_ better than hacking in half of the support and
leaving the other half only usable by one company.

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