只是为了让我自己安心,我想知道为什么在我的 AssemblyInfo.fs
文件的最后一行中,有必要添加一个 ()
命令它编译。你怎么称呼这个语法?
namespace TestComComponentFSharp
open System.Reflection
open System.Runtime.CompilerServices
open System.Runtime.InteropServices
[<assembly: AssemblyTitle("TestComComponentFSharp")>]
[<assembly: ComVisible(true)>]
[<assembly: Guid("0B684F15-DC37-40C0-A785-EDF1A63BBAF5")>]
[<assembly: AssemblyKeyFile("KeyFile.snk")>]
[<assembly: AssemblyVersion("1.0.0.0")>]
[<assembly: AssemblyFileVersion("1.0.0.0")>]
()
最佳答案
您需要一些东西来应用这些程序集属性。这就是empty()或do()的用途。它称为“空表达式” - 它返回一个单位。
关于F#:为什么需要这些括号(语法),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30525731/