在我的OCaml程序,我有以下幾點:匹配「*」 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"
,但我仍然得到同樣的錯誤。有人可以幫我嗎?
謝謝!非常豐富 – Abundance