caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Unset or remove an OCaml callback registration
@ 2008-04-02 18:12 Hezekiah M. Carty
  2008-04-03  0:26 ` [Caml-list] " Jacques Garrigue
  0 siblings, 1 reply; 4+ messages in thread
From: Hezekiah M. Carty @ 2008-04-02 18:12 UTC (permalink / raw)
  To: Caml-list List

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-04-03 14:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-02 18:12 Unset or remove an OCaml callback registration Hezekiah M. Carty
2008-04-03  0:26 ` [Caml-list] " Jacques Garrigue
2008-04-03 14:07   ` Hezekiah M. Carty
2008-04-03 14:25     ` Gordon Henriksen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).