小编use*_*123的帖子

OCaml 中的“int/2”类型是什么

当我在交互环境(OCamlutop)中执行以下命令时,所有“int”类型的表达式都变成了“int/2”类型。这种行为可以复制如下。

# 3;;
- : int = 3

# type int;;
type int

# type a;;
type a

# 3;;
- : int/2 = 3
Run Code Online (Sandbox Code Playgroud)

有谁知道为什么会这样?谢谢!

2020 年 3 月 2 日编辑:

我发现如果我执行以下操作,“int/2”将不会出现。谁能解释一下这里发生了什么?

# 3;;
- : int = 3

# type int;;
type int

# 3;;
- : int = 3
Run Code Online (Sandbox Code Playgroud)

更新:以上情况使用了OCaml 4.08.1 版

ocaml utop

2
推荐指数
1
解决办法
110
查看次数

标签 统计

ocaml ×1

utop ×1