F#NumericLiteral:FromString方法

Giu*_*ore 1 f#

有谁知道是否有办法在F#中自动调用数字文字的FromString方法?我已经尝试(并成功)使用FromOne,FromZero等方法,但我不知道在编译时如何处理字符串...

Yin*_*Zhu 5

来自F#语言规范的第51页:

xxxx<suffix>
For xxxx = 0 -> NumericLiteral<suffix>.FromZero()
For xxxx = 1 -> NumericLiteral<suffix>.FromOne()
For xxxx in the Int32 range -> NumericLiteral<suffix>.FromInt32(xxxx)
For xxxx in the Int64 range -> NumericLiteral<suffix>.FromInt64(xxxx)
For other numbers -> NumericLiteral<suffix>.FromString("xxxx")
Run Code Online (Sandbox Code Playgroud)

这意味着,只有当前4个不满足时才FromString被调用.此外,xxxx必须是带符号的数字,您不能使用其他字母设置为xxxx.