我是这门语言的新手.为了尝试和理解参考我已经尝试实施一个简单的定向列表新生大学计算机科学的方式.
type item = {
value:float
next:ref<item>
}
type list() =
let head:ref<item> = null // tried instantiation so many different ways and it likes none of em
let sum i =
if i == null then
0
else
i.value + sum i.next // constructor not defined?
Run Code Online (Sandbox Code Playgroud)
请告诉我为什么我不好