【发布时间】:2018-03-15 02:35:42
【问题描述】:
我是一个新的 OCaml 学习者,我正在尝试使用 Jane Street 的 Sexplib(包含在 Core 中)打印一些 S 表达式:
let rec print_source ?(channel = stdout) sexps =
let formatter = Format.formatter_of_out_channel channel in
Sexp.pp_hum formatter |> List.iter sexps
但是,这似乎没有向stdout 输出任何内容。如果我用不使用格式的版本替换它,它工作正常:
let rec print_source ?(channel = stdout) sexps =
Sexp.output_hum channel |> List.iter sexps
感谢任何 OCaml 专业知识! (另外,很高兴听到这是否是超级单调的,我只是做错了????)
【问题讨论】:
标签: ocaml string-formatting s-expression ocaml-core