[mercury-users] Some more Queries

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Nov 7 21:26:30 AEDT 2002


On 07-Nov-2002, Noel  Pinto <cool4life at rediffmail.com> wrote:
> I have some more queries. I am trying to consolidate them here, 
> instead of sending separate mails.
> 
> 1) io__open_input(File, Result, IO0, IO)
> The Result is either ok(Stream) or error(ErrorCode)
> Plz tell me what is the Stream in ok(Stream)?? , because in this 
> syntax the input is made in the file.
> What is ErrorCode???

Stream and Error code are values of abstract data types.
You can tell which type each is by looking at the `:- pred'
declaration for io__open_input.  The values returned can then
be used to call other procedures defined in the io module.
For Error, you can pass it to io__error_message.
For Stream, you can pass it to procedures such as io__set_input_stream
or the four-argument version of io__read_char.

> 2) In io__input_stream_name, for a file stream, the human readable 
> name associated the current input stream is retreived and for 
> stdin a string <standard input> is retreived.
> Why is standard input in brackets?

To more clearly distinguish it from a file name.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list