[MLton-devel] cvs commit: -exn-history reimplemted
Matthew Fluet
Matthew Fluet <fluet@CS.Cornell.EDU>
Mon, 26 Aug 2002 13:47:25 -0400 (EDT)
> > I suspect we could get away with always having implement-exceptions.fun
> > rewrite as if exn-history were true. Then -exn-history would only affect
> > the behaviour of MLton.Exn.history. When it was false, nothing could
> > access the history component and it would be eliminated.
>
> I wouldn't want to do this because people might want to use
> MLton.Exn.history in their programs, but not always incur the cost.
No, I meant leave the implementation of MLton.Exn.history the same:
val history: t -> string list =
if keepHistory
then (setInitExtra ([]: extra)
; setExtendExtra (op ::)
; extra)
else fn _ => []
where it is predicated on the keepHistory constant. When -exn-history is
false, then MLton.Exn.history would simplify to fn _ => [] (as it does
now). Then nothing could access the history component and it would be
eliminated. When -exn-history is true, then it would acces the history
component and it would be kept so long as the program did something
"useful" with it. (In practice, the top-level handler would always do
something useful with it by printing it, so it would be kept around.)
-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel