某处是否有有效前缀运算符名称列表?我无法找到一个,但我注意到一些曾经在最后一个CTP中作为前缀运算符有效的运算符在RC中不再有效.
let (~--) (str:string) = [str];;
-----^^^
stdin(4,6): error FS1208: Invalid operator definition.
Prefix operator definitions must use a valid prefix operator name.
Run Code Online (Sandbox Code Playgroud)
编辑:
Brian的链接包括以下有效前缀运算符列表:
! (or repetitions of !)
~ (or repetitions of ~)
+
-
+.
-.
%
%%
&
&&
Run Code Online (Sandbox Code Playgroud)
我的链接下面仅列出了这些运算符:
~
!
?
Run Code Online (Sandbox Code Playgroud)
快速测试表明,MSDN文档似乎不符合语言规范.谢谢,Brian.
f# ×1