Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ocaml lib函数的节点定义_Ocaml - Fatal编程技术网

Ocaml lib函数的节点定义

Ocaml lib函数的节点定义,ocaml,Ocaml,在map.ml lib文件中,函数高度定义如下: let height = function Empty -> 0 | Node(_,_,_,_,h) -> h 我的问题是:节点实际定义在哪里 我搜索了整个ocaml源文件集,什么也没找到 谢谢 在map.ml的OCaml 4.05.0源代码中,我看到: type 'a t = Empty | Node of 'a t * key * 'a * 'a t * int let height = functio

在map.ml lib文件中,函数高度定义如下:

let height = function
    Empty -> 0
  | Node(_,_,_,_,h) -> h
我的问题是:节点实际定义在哪里

我搜索了整个ocaml源文件集,什么也没找到


谢谢

在map.ml的OCaml 4.05.0源代码中,我看到:

type 'a t =
    Empty
  | Node of 'a t * key * 'a * 'a t * int

let height = function
    Empty -> 0
  | Node(_,_,_,_,h) -> h

定义就在高度函数之前。

非常感谢。我对ocaml语法非常陌生,因此我搜索的是Node=而不是Node of。事实上,我在另一个文件中找到了我要找的东西,它完全错了,很酷,很乐意帮忙。如果您是OCaml新手,那么最好从比标准库实现更简单的东西开始:-几个较小的示例可能会让您走得更快。