- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是 OCaml 的新手,我正在尝试 (:P) Facebook Reason 语法。我找不到编译的方法,因为如果找不到核心模块(已经安装了 opam)。
我正在尝试从 Real World OCaml 编译示例程序
open Core.Std;
let rec read_and_accumulate accum => {
let line = In_channel.input_line In_channel.stdin;
switch line {
| None => accum
| Some x => read_and_accumulate (accum +. Float.of_string x)
}
};
let () = printf "Total: %F\n" (read_and_accumulate 0.);
rebuild accum.native
.
_tags
中有这个时(来自
https://janestreet.github.io/installation.html 中的说明)
true: package(core,ppx_jane)
true: thread,debug
File "_tags", line 1, characters 6-28:
Warning: tag "package" does not expect a parameter, but is used with parameter "core,ppx_jane"
File "_tags", line 1, characters 6-28:
Warning: the tag "package(core,ppx_jane)" is not used in any flag or dependency declaration, so it will have no effect; it may be a typo. Otherwise you can use `mark_tag_used` in your myocamlbuild.ml to disable this warning.
+ /Users/David/.opam/4.02.3/bin/ocamldep.opt -modules -pp refmt -impl accum2.re | tee accum2.re.depends accum2.ml.depends
accum2.re: Core Float In_channel
+ /Users/David/.opam/4.02.3/bin/ocamlc.opt -c -g -thread -pp '-g -thread' -pp refmt -o accum2.cmo -intf-suffix .rei -impl accum2.re
File "accum2.re", line 1, characters 5-13:
Error: Unbound module Core
Command exited with code 2.
Compilation unsuccessful after building 2 targets (0 cached) in 00:00:00.
最佳答案
基本上是 https://janestreet.github.io/installation.html 中指示的标签必须添加另外三个用于这种情况的标志和值:
-linkpkg
对于静态链接,我假设 -pp refmt
表示 ReasonML 预处理器 -impl file.re
告诉要读取什么文件accum.re
它可以通过以下方式编译为 native 二进制文件:
ocamlfind ocamlc -g -thread -package ppx_jane -package core -pp refmt -linkpkg -o accum.native -impl accum.re
关于ocaml - 如何使用 Jane Street 的 Core with Reason?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37504534/
我正在阅读 https://realworldocaml.org/ (顺便说一句,这是一本了不起的书)并且所有示例都假定使用 Jane Street Core 库。我还不熟悉 OCaml 环境,想在我
我是 OCaml 的新手,我正在尝试 (:P) Facebook Reason 语法。我找不到编译的方法,因为如果找不到核心模块(已经安装了 opam)。 我正在尝试从 Real World OCam
我正在 OCaml 中使用 Jane Street 的异步库进行并发处理一个项目。我想让多个 TCP 服务器接受输入,它们的处理程序操纵单个哈希表(Hashtbl.t)。似乎这种情况需要我使用互斥体(
我正在 OCaml 中使用 Jane Street 的异步库进行并发处理一个项目。我想让多个 TCP 服务器接受输入,它们的处理程序操纵单个哈希表(Hashtbl.t)。似乎这种情况需要我使用互斥体(
我是 OCaml 的新手,经常有人建议我使用 Jane Street 的标准库,而不是编译器附带的标准库。 但是,似乎甚至有几个,我不知道我应该使用哪个: Base , Core , 和 Core_k
在这个 blog post作者写道: However, Grenchman is built on the Core and Async libraries from Jane Street, one
我是一名优秀的程序员,十分优秀!