Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Xavier Leroy <Xavier.Leroy@inria.fr>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Nested callbacks?
Date: Tue, 05 Jul 2011 19:31:53 +0200	[thread overview]
Message-ID: <4E134A89.7070307@inria.fr> (raw)
In-Reply-To: <4E133C2F.6050202@soton.ac.uk>

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



  reply	other threads:[~2011-07-05 17:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-05 16:06 Dmitry Bely
2011-07-05 16:25 ` Guillaume Yziquel
2011-07-05 16:30 ` Thomas Fischbacher
2011-07-05 17:31   ` Xavier Leroy [this message]
2011-07-05 17:52     ` Dmitry Bely
2011-07-05 18:06       ` rixed
2011-07-05 18:17         ` Dmitry Bely
2011-07-06  9:00           ` Dmitry Bely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E134A89.7070307@inria.fr \
    --to=xavier.leroy@inria.fr \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox