OptionsPattern

WMA link


OptionsPattern[f]

is a pattern that stands for a sequence of options given to a function, with default values taken from Options[f]. The options can be of the form opt->value or opt:>value, and might be in arbitrarily nested lists.

OptionsPattern[{$opt_1$->$value_1$, ...}]

takes explicit default values from the given list. The list may also contain symbols f, for which Options[f] is taken into account; it may be arbitrarily nested. OptionsPattern[{}] does not use any default values.

The option values can be accessed using OptionValue.

Delayed rules as options:

Options might be given in nested lists:

See also Options and OptionValue.

Longest
Pattern