【发布时间】:2015-11-02 01:15:22
【问题描述】:
在我的 OCaml 程序中,我有以下内容:
let rec string_of_list p "" = match p with
[] -> "[]"
|s::rest -> String.concat " " [Bytes.to_string s; string_of_list rest ""]
这段代码嵌套在更多代码中,但是当我编译它时,我得到了错误:
Warning 8: this pattern-matching is not exhaustive.
Here is an example of a value that is not matched:
"*"
星星是指 Kleene 围场吗?我尝试通过附加以下匹配来解决问题:
| _ -> "ERROR"
但我仍然得到同样的错误。有人可以帮帮我吗?
【问题讨论】: