Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] C++ Throws
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: David McClain <David.McClain@A...>
Subject: [Caml-list] C++ Throws
I now see that OCaml is not converting anything, per se... Apparently 
when the throw handler detects an unhandled condition it decides to 
call abort(), against which there is no defense.

However, it also appears that once a C call returns to OCaml, OCaml 
reinstates its own trap handling, overriding anything that may have 
been left in place by the called C function. This is possibly 
understandable.

But by the same token, at startup, I call a C main() which in turn 
starts up OCaml. That give it a chance to establish its environment. 
Then the main routine designated in OCaml calls another C routine that 
encloses a callback to OCaml within try-catch, and this is being 
overridden by OCaml.

So there appears to be something relatively complex going on across the 
foreign function interface with OCaml and C. This override is what 
frustrates the attempts to create a generic C++ exception handler.

David McClain
Senior Corporate Scientist
Avisere, Inc.

david.mcclain@avisere.com
+1.520.390.7738 (USA)

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners