Ocaml lib函数的节点定义
在map.ml 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
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新手,那么最好从比标准库实现更简单的东西开始:-几个较小的示例可能会让您走得更快。