如何实现具有可变数量参数的方法?
public class MyClass
{
public static void UseParams(params int[] list)
{
for (int i = 0; i < list.Length; i++)
{
Console.Write(list[i] + " ");
}
Console.WriteLine();
}
}
那么我怎样才能在 F# 中做到这一点呢?
type MyClass() =
member this.SomeMethod(params (args:string array)) = ()
我从上面的代码中收到以下错误:
The pattern discriminator 'params' is not defined