Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
RE: Where did the exception occur?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Greg Morrisett <jgm@c...>
Subject: RE: Where did the exception occur?
> I'm not the OP, but this can of course be implemented by having an
> additional (hidden) field in the exception which contains the source
> co-ordinate.

This is really cheap to add.  But it's not very useful in
practice.  The problem is that you call a higher order
function (e.g., find or something like that) and you really
need to know who called that function to narrow down the
context suffiently.  What you really want is a stack backtrace
hence my suggestion.  And Pierre is (rightfully) worried
about the overhead of supporting the full backtrace.

Still, it's so useful that I would highly encourage its
support.  (We've done this with our Popcorn compiler recently
in a rather naive way, and in spite of the overhead, I leave 
it on all the time because it's just so useful.)