Re: exnMessage returns text without Message

Kostirya <[email protected]> Wed, 17 Aug 2016 08:30:55 +0300
Newsgroups gmane.comp.lang.ml.mlton.user
Message-ID <CAG+QnTfy8Bt=M-SBTSu2kFqSO8yys7DZDjDXf5tKWZhifA0nQw@mail.gmail.com>
Thank you very much.

2016-08-16 23:55 GMT+03:00 Phil Clayton <[email protected]>:

> The Basis Library specification
> http://sml-family.org/Basis/general.html#SIG:GENERAL.exnMessage:VAL
> says that an implementation can choose whether "exnMessage ex" includes
> more than just "exnName ex", so I think MLton is technically compliant.
> However, you can add your own exception printers using
> MLton.Exn.addExnMessager - see
> http://mlton.org/MLtonExn
>
> For example, adding the following should give the effect you want:
>
> val () =
>    MLton.Exn.addExnMessager
>      (fn Foo s => SOME ("Foo \"" ^ s ^ "\"") | _ => NONE)
>
> Phil
>
> On 16/08/16 15:24, Kostirya wrote:
> > Hello.
> > Probably, there is a bug: exMessage returns only exnName without Message.
> >
> >> cat foo_exc.sml
> > exception Foo of string
> > fun foo () = raise Foo "foo msg"
> > val _ = foo () handle exc => print ("Raised an exception: " ^ exnMessage
> > exc ^ ".\n")
> >
> > I expect to get:
> > Raised an exception: Foo "foo msg".
> >
> > By I got:
> >
> >> mlton foo_exc.sml && ./foo_exc
> > Raised an exception: Foo.
> >
> >> mlton
> > MLton 20130715 (built Sun May  8 19:16:42 UTC 2016 on bsd)
> >
> > And last git version of mlton have this error.
> >
> > Best. Nick.
> >
> >
> > ------------------------------------------------------------
> ------------------
> >
> >
> >
> > _______________________________________________
> > MLton-user mailing list
> > [email protected]; [email protected]
> > https://lists.sourceforge.net/lists/listinfo/mlton-user
> >
>
>
> ------------------------------------------------------------
> ------------------
> _______________________________________________
> MLton-user mailing list
> [email protected]; [email protected]
> https://lists.sourceforge.net/lists/listinfo/mlton-user
>

-- 
You received this message because you are subscribed to the Google Groups "MLton-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

------------------------------------------------------------------------------

_______________________________________________
MLton-user mailing list
[email protected]; [email protected]
https://lists.sourceforge.net/lists/listinfo/mlton-user