Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个结构,它有一个名为type
type
我如何在 F# 中访问它?
C#
struct A { int type; }
F#
let a = A() let myThing = a.type //error because type is a reserved keyword
我如何访问的type领域A?
A
您正在type像静态字段一样访问。首先,您需要一个实例A:
let a = A() let x = a.``type``
您可以使用双反引号来限定它A.``type``。
A.``type``