From: "Hezekiah M. Carty" <hcarty@atmos.umd.edu>
To: "Caml-list List" <caml-list@inria.fr>
Subject: Unset or remove an OCaml callback registration
Date: Wed, 2 Apr 2008 14:12:10 -0400 [thread overview]
Message-ID: <3a360f590804021112r1cba67d9yc1715c08fb4a2e92@mail.gmail.com> (raw)
Is it possible to unregister a function or other value registered with
Callback.register? I use (Callback.register "foo" some_func) to
register coordinate transforms for a C library. If no callback is
registered for "foo" then a default transform is used by the C
library. I would like to be able to set and then remove the
association of some_func to the name "foo" at various points in my
program so that the C code will fall back on the default transform
(which does not require a callback and is much faster) when the named
callback "foo" is undefined or has been unregistered.
Is this possible, either from the C or OCaml side without making the
callback associate with "foo" an option type (use (Callback.register
"foo" (Some some_func)) to set a callback and (Callback.register "foo"
None) to clear it)?
Thanks,
Hez
--
Hezekiah M. Carty
Graduate Research Assistant
University of Maryland
Department of Atmospheric and Oceanic Science
next reply other threads:[~2008-04-02 18:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-02 18:12 Hezekiah M. Carty [this message]
2008-04-03 0:26 ` [Caml-list] " Jacques Garrigue
2008-04-03 14:07 ` Hezekiah M. Carty
2008-04-03 14:25 ` Gordon Henriksen
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=3a360f590804021112r1cba67d9yc1715c08fb4a2e92@mail.gmail.com \
--to=hcarty@atmos.umd.edu \
--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