Accessing a namespace containing .base in its name from F#
As the title says, I'm trying to use a class declared in a namespace which contains "base" in its name. Think of a situation like the following:
开发者_运维百科open Foo.base.Bar
In C# I'd just use @ before base but F# seems to ignore that and to think that @ is the infix operator used for list concatenation. Since the namespace belongs to a third-party library which I cannot modify, is there a way I can still access it from F#?
In F#, you can achieve similar thing by enclosing the special name between two pairs of `` symbols. The following should do the trick:
open Foo.``base``.Bar
This is a bit more flexible than in C# - the name can contain almost anything, so you can for example define members with space in the name:
let ``some name!`` = 42
精彩评论