我有以下代码语句:
let execute command =
match command with
|Skip -> ()
|Changestate (l,r) -> (let l = ref r)
|_ -> failwith "Not a command"
当我在顶层运行它时,我收到以下错误:
1 let execute command =
2 match command with
3 |Skip -> ()
4 |Changestate (l,r) -> (let l = ref r)
5 |_ -> failwith "Not a command";;
6 Error: Syntax error
语法错误似乎出现在第 4 行末尾的括号中。我希望这一行做的是将 l 处的值更改为 r 的引用变量,但不返回实际值。