2
可変数の引数を使用してメソッドを実装するにはどうすればよいですか?可変数の引数を持つメソッドを実装するにはどうすればよいですか?
In C#, we can use the params keyword:
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)) =()
私は上記のコードから、次のエラーが表示されます。あなたはParamArrayAttribute
を使用することができます
The pattern discriminator 'params' is not defined
が重複する可能性を、どのようにParamArray関数をカレーするのですか?(li ke sprintf)?](http://stackoverflow.com/questions/11145680/in-f-how-do-you-curry-paramarray-functions-like-sprintf) –