In C#, I can do the following:
int @private = 15;
And in VB.NET, I can do the following:
Dim [Private] As Integer = 15
I am wondering if there is a way in F# to use reserved keywords as identifiers, like there is in VB.NET and C#?
Join Stack Overflow to learn, share knowledge, and build your career.
In C#, I can do the following:
int @private = 15;
And in VB.NET, I can do the following:
Dim [Private] As Integer = 15
I am wondering if there is a way in F# to use reserved keywords as identifiers, like there is in VB.NET and C#?
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.
let ``let`` = 75
and System.Console.WriteLine(``let``)
it worked. So know we all know. Thanks for the help
– Icemanind
Jul 10 '11 at 6:58
Tags
Err FS1219
– mamcx
Jun 11 '15 at 15:06