[m-dev.] Even more minimal diff

Michael Day mikeday at yeslogic.com
Thu Oct 3 14:38:40 AEST 2002


Estimated hours taken: 1

Adding a function to io.m to construct io__error code from error messages,
which is useful for stream implementations and any other module that
wishes to return io__result and can fail for reasons of its own making.

Michael

Index: NEWS
===================================================================
RCS file: /home/mercury1/repository/mercury/NEWS,v
retrieving revision 1.269
diff -u -r1.269 NEWS
--- NEWS	26 Sep 2002 06:18:33 -0000	1.269
+++ NEWS	3 Oct 2002 04:35:05 -0000
@@ -117,6 +117,9 @@
 
 Changes to the Mercury standard library:
 
+* We've added a function to io.m to construct io__error codes from error
+  messages: `io__make_io_error'.
+
 * The assumptions that we make about user supplied comparison predicates and
   functions have been relaxed to allow more general orderings.  The new
   assumptions are documented in builtin.m.

Index: library/io.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/io.m,v
retrieving revision 1.266
diff -u -r1.266 io.m
--- library/io.m	24 Sep 2002 06:55:17 -0000	1.266
+++ library/io.m	3 Oct 2002 04:35:07 -0000
@@ -1211,6 +1211,10 @@
 %		The `ExitStatus' will be 0 if the command completed
 %		successfully or the return value of the command otherwise.
 
+:- func io__make_io_error(string) = io__error.
+%	io__make_io_error(ErrorMessage) = ErrorCode.
+%		Construct an error code including the specified error message.
+
 :- func io__error_message(io__error) = string.
 :- pred io__error_message(io__error, string).
 :- mode io__error_message(in, out) is det.
@@ -3282,6 +3286,8 @@
 	% because io__print, which may be called to print out the uncaught
 	% exception if there is no exception hander, does not print out
 	% the module name.
+
+io__make_io_error(Error) = io_error(Error).
 
 io__error_message(io_error(Error), Error).
 


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