In the source code for the lambda-term
package, there is a file called lTerm_widget_callbacks.ml
(at https://github.com/ocaml-community/lambda-term/blob/master/src/lTerm_widget_callbacks.ml
) that starts as follows :
(*
* lTerm_widget_callbacks.ml
* ---------------
* Copyright : (c) 2011, Jeremie Dimino <jeremie@dimino.org>
* Licence : BSD3
*
* This file is a part of Lambda-Term.
*)
let section = Lwt_log.Section.make "lambda-term(widget_callbacks)"
My problem is, that I can’t really figure out how this Lwt_log
module is constructed. There is no lwt_log.ml
file in the source for Lwt
or lambda-term
, so it seems that this module is not constructed the usual way.
In https://github.com/ocsigen/lwt/blob/master/src/ppx/ppx_lwt.ml
I see a code snippet as follows :
(**
[Lwt_log.error "message"] ≡
[let __pa_log_section = Lwt_log.Section.main in
if Lwt_log.Error >= (Lwt_log.Section.level __pa_log_section)
then Lwt_log.error ~location:("foo.ml", 1, 0) ~section:__pa_log_section "message"
else Lwt.return_unit];
[Lwt_log.error ~section "message"] ≡
[let __pa_log_section = section in ...].
Additionally, remove debug-level statements if -no-debug is given. **)
let lwt_log mapper fn args attrs loc =
Which makes me think that ppx is involved.
Can I somehow “translate” the parts of the code that use this Lwt_log
module to more “elementary” OCaml code not relying on ppx ?