为什么我不能做以下事情,有什么方法可以做到这一点?
datatype boolexp = zero
| one
| compl of boolexp;
fun convert (#"1"::nil) = one
| convert (#"0"::nil) = zero
| convert (#"-":: #"(" :: xs @ [#")"]) = compl (convert xs)
它给了我错误:
non-constructor applied to argument in pattern: @
unbound variable or constructor: xs