【发布时间】:2013-07-02 11:26:00
【问题描述】:
如何在盒装元组上进行模式匹配?或者有没有更好的方法来做这样的事情(简化示例):
open System.Drawing
let coerceColor a =
match box a with
| :? Color as c -> c
| (:? int as r),(:? int as g),(:? int as b) -> Color.FromArgb(r,g,b)
| _ -> failwith "Cannot coerce color"
【问题讨论】:
标签: f# pattern-matching