David,

The basis library documentation for exception SysErr states:

 ...but if a SysErr exception has the form SysErr (s, SOME e),
 then we have errorMsg e = s.

http://www.standardml.org/Basis/os.html

However, it appears that Poly/ML is not always preserving that property because errorMsg e and s are sometimes different strings, for example:

val () = ignore (TextIO.openIn "a non-existent file name")
 handle
   e as IO.Io {cause, ...} => (
     case cause of
       OS.SysErr (s, SOME e) => (
         print "\n";
         app print ["s          = \"", s,             "\"\n"];
         app print ["errorMsg e = \"", OS.errorMsg e, "\"\n"]
       )
     | _                     => ()
   );

If the Standard is to be followed and one of the messages must be chosen, the string returned by errorMsg e seems to be the useful one as s can be deduced from the structure of the program, at least in this example.

Regards,
Phil



_______________________________________________
polyml mailing list
[email protected]
http://lists.inf.ed.ac.uk/mailman/listinfo/polyml

Reply via email to