相关疑难解决方法(0)

如何在OCaml中返回for循环的索引?

let find_free_next heap start = 
  for i = start to ((Array.length heap)-1) do
     match heap.(i) with 
     Hdr (Free (h), g)  ->
        i
  done
Run Code Online (Sandbox Code Playgroud)

一旦找到匹配,我怎样才能将循环的索引作为整数返回?

ocaml functional-programming

8
推荐指数
3
解决办法
298
查看次数

标签 统计

functional-programming ×1

ocaml ×1