package batteries

  1. Overview
  2. Docs
A community-maintained standard library extension

Install

dune-project
 Dependency

Authors

Maintainers

Sources

batteries-3.11.0.tar.gz
md5=096be9e83e347b4c7b5b6e5b2af22992
sha512=621dca842c4a7adf0ac1e907bf44c1405e0b66a088987a138a4f4e98ca744815913bf87fd780619151cb049a07d7fdb1e8adb7b65698ab46b8c2dfe46cd7119d

doc/batteries.unthreaded/BatPrintexc/Slot/index.html

Module BatPrintexc.SlotSource

Sourceval is_raise : t -> bool

is_raise slot is true when slot refers to a raising point in the code, and false when it comes from a simple function call.

  • since 2.3.0 and OCaml 4.02
Sourceval is_inline : t -> bool

is_inline slot is true when slot refers to a call that got inlined by the compiler, and false when it comes from any other context.

  • since 4.04.0
Sourceval location : t -> location option

location slot returns the location information of the slot, if available, and None otherwise.

Some possible reasons for failing to return a location are as follow:

  • the slot corresponds to a compiler-inserted raise
  • the slot corresponds to a part of the program that has not been compiled with debug information (-g)
  • since 2.3.0 and OCaml 4.02
Sourceval name : t -> string option

name slot returns the name of the function or definition enclosing the location referred to by the slot.

name slot returns None if the name is unavailable, which may happen for the same reasons as location returning None.

  • since 4.11
Sourceval format : int -> t -> string option

format pos slot returns the string representation of slot as raw_backtrace_to_string would format it, assuming it is the pos-th element of the backtrace: the 0-th element is pretty-printed differently than the others.

Whole-backtrace printing functions also skip some uninformative slots; in that case, format pos slot returns None.

  • since 2.3.0 and OCaml 4.02