在F#中使用关键字作为标识符 [英] Using keywords as identifiers in F#

查看:95
本文介绍了在F#中使用关键字作为标识符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在C#中,我可以执行以下操作:

In C#, I can do the following:

int @private = 15;

在VB.NET中,我可以执行以下操作:

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

Dim [Private] As Integer = 15

我想知道F#中是否可以像VB.NET和C#中那样使用保留关键字作为标识符?

I am wondering if there is a way in F# to use reserved keywords as identifiers, like there is in VB.NET and C#?

推荐答案

给出

标识符遵循以下规范.包含在双反引号(``)中的任何字符序列(不包括换行符,制表符和双反引号对本身)都被视为标识符.

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``

我还没有尝试过.

这篇关于在F#中使用关键字作为标识符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆