This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.

# Optional

 is a pattern object that represents an expression of the form p, which, if omitted, should be replaced by v.
• Optional is used to specify "optional arguments" in functions represented by patterns. The pattern object p gives the form the argument should have, if it is present. The expression v gives the "default value" to use if the argument is absent.
• The form is equivalent to Optional. This form is also equivalent to . There is no syntactic ambiguity since s must be a symbol in this case.
• The special form is equivalent to Optional and can be used to represent function arguments which, if omitted, should be replaced by default values globally specified for the functions in which they occur.
• Values for Default specify default values to be used when appears as an argument of f. Any assignments for Default must be made before first appears as an argument of f.
• Optional represents a function which can be omitted, but which, if present, must have head h. There is no simpler syntactic form for this case.
• Functions with built-in default values include Plus, Times, and Power.
Use the function with both arguments specified explicitly:
The second argument is now taken to have its default value:
Use the function with both arguments specified explicitly:
 Out[2]=
The second argument is now taken to have its default value:
 Out[3]=
New in 1