ᆼᆺᆼ*_*ᆼᆺᆼ 4 f# pattern-matching
OCaml的等价物是什么:
match x with
| 'a'..'k' -> 1
...
Run Code Online (Sandbox Code Playgroud)
在F#中?
(缺乏| 'a' | 'b' | 'c' ...:)
您可以使用匹配守卫来添加条件:
match x with
| t when t >= 'a' && t <= 'k' -> 1
Run Code Online (Sandbox Code Playgroud)