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 with caml_named_value(n) πŸ’–
  • register_exception β†’ puts an exception under a name so C can find it with caml_named_value(n), and the result plugs straight into raise_constant or raise_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