Using keywords as identifiers in F#

前端 未结 1 1458
时光说笑
时光说笑 2020-11-30 08:23

In C#, I can do the following:

int @private = 15;

And in VB.NET, I can do the following:

Dim [Private] As Integer = 15


        
相关标签:
1条回答
  • 2020-11-30 08:54

    Given section 3.4 of the F# 2.0 spec:

    Identifiers follow the specification below. Any sequence of characters that is enclosed in double-backtick marks (`` ``), excluding newlines, tabs, and double-backtick pairs themselves, is treated as an identifier.

    I suspect you can put it in backticks:

    ``private``
    

    I haven't tried it though.

    0 讨论(0)
提交回复
热议问题