On 07/05/2011 06:30 PM, Thomas Fischbacher wrote: > > Dmitry Bely wrote: > >> Is it allowed to call a Caml closure from C (caml_callbackN_exn), that >> calls another Caml closure internally (also with caml_callbackN_exn)? > > I strongly hope so! If this did not work, that would have disastrous > consequences for the tight integration of Caml and Python which we are > using. (Well, so far, we never encountered a problem with that. And the > documentation does not warn against doing this - so, should it not work, > that should be considered a bug.)
Indeed, it should work, and I see no reason why nested callbacks could fail. Callbacks do save some Caml-specific state and restore it before returning, but they use the stack to do so, so they should be reentrant. Please file a bug report if you find out they are not. - Xavier Leroy -- Caml-list mailing list. Subscription management and archives: https://sympa-roc.inria.fr/wws/info/caml-list Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
