Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/fsharp/language-reference/parameters-and-arguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ Occasionally it is necessary to define a function that takes an arbitrary number

In F#, parameter arrays can only be defined in methods. They cannot be used in standalone functions or functions that are defined in modules.

However, functions like `printfn` achieve similar behavior by using format specifiers and type inference to handle multiple arguments dynamically. The `printfn` function does not rely on parameter arrays; instead, it uses F#'s type-safe formatting mechanism to process varying numbers of arguments while ensuring compile-time type checking.

You define a parameter array by using the `ParamArray` attribute. The `ParamArray` attribute can only be applied to the last parameter.

The following code illustrates both calling a .NET method that takes a parameter array and the definition of a type in F# that has a method that takes a parameter array.
Expand Down
Loading