OptionsPattern[f]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$, ...}]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.
f[x_, OptionsPattern[{n->2}]] := x ^ OptionValue[n]
f[x]
f[x, n->3]
Delayed rules as options:
e = f[x, n:>a]
a = 5;
e
Options might be given in nested lists:
f[x, {{{n->4}}}]
See also Options and OptionValue.