【发布时间】:2021-07-05 13:22:42
【问题描述】:
在下面的 F# sn-p
let (?) (map : Map<string, string>) (key : string) = map.[key]
let map = [("aKey", "aValue"); ("another Key", "another Value")] |> Map.ofList
let a = map.["aKey"]
let b = map?aKey
assert (a = b)
let c = map.["another Key"] //OK
let d = map?another Key //How should this be written?
assert (c = d)
let d = map?... 行的正确语法是什么?
【问题讨论】: