Stdlib.Callback(3)
π Stdlib.Callback(3) π
okay so bestie, welcome to the OCaml library manpage for Stdlib.Callback β yes that's the Stdlib.Callback(3) situation, we're doing this, grab a strawberry π and let's go.
β¨ NAME β¨
Stdlib.Callback β no description π
fr fr the manpage literally just says "no description" and honestly? iconic. but don't worry, the actual tea is down below π«
π¦ Module π¦
Module β it's Stdlib.Callback, bestie.
π Documentation π
so it's Module Callback, and lowkey it's just:
: (module Stdlib__Callback)
that's the whole vibe. moving on π
β the functions
val register : string -> 'a -> unit
okay so Callback.register n v registers the value v under the name n. and then β the way that C code can later retrieve a handle to v by calling caml_named_value(n)? obsessed. π₯ that's it, that's the whole function. no cap.
val register_exception : string -> exn -> unit
and Callback.register_exception n exn registers the exception contained in the exception value exn under the name n. same energy as before: C code can later retrieve a handle to that exception by calling caml_named_value(n). π
and this is the important bit, bestie: the exception value you get back that way is suitable for passing as first argument to raise_constant or raise_with_arg. so like, that's the whole point. periodt. π
π§ quick vibe check recap
registerβ puts a value under a name so C can find it withcaml_named_value(n)πregister_exceptionβ puts an exception under a name so C can find it withcaml_named_value(n), and the result plugs straight intoraise_constantorraise_with_argβ¨
πΈ okay that's the page!! short and sweet, just like the original. this was Stdlib.Callback(3) from the OCaml library, generated by OCamldoc, dated 2026-06-22 β so yeah, she's a fresh one. mwah, bye bestie, go forth and register your callbacks ππ«Άπ
π¦ where this page comes from
- arch rolling: ocaml 5.5.0-1 Β· LGPL2.1 AND custom: QPL-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms