Skip to content

Options

Returns or sets the options associated with a symbol.

The core symbolic and numeric functions report their built-in defaults:

$ wo 'Options[Total]'
{AllowedHeads -> Automatic, Method -> Automatic}
$ wo 'Options[Factor]'
{Extension -> None, GaussianIntegers -> False, Modulus -> 0, Trig -> False}

An option whose default is a global stays a delayed rule:

$ wo 'Options[Series]'
{Analytic -> True, Assumptions :> $Assumptions, SeriesTermGoal -> Automatic}

A second argument selects one option:

$ wo 'Options[Simplify, TimeConstraint]'
{TimeConstraint -> 300}

A symbol with no options reports none:

$ wo 'Options[Sin]'
{}

SetOptions replaces entries in the list and returns the updated one:

$ wo 'SetOptions[Total, Method -> "X"]'
{AllowedHeads -> Automatic, Method -> X}

The change sticks, and OptionValue reads it back:

$ wo 'SetOptions[Total, Method -> 7]; OptionValue[Total, Method]'
7

A name that is not already an option refuses the whole call, so nothing is changed even when other names in it are valid:

$ wo 'SetOptions[Total, Bogus -> 1, Method -> 9]'

SetOptions::optnf: Bogus is not a known option for Total.
SetOptions[Total, Bogus -> 1, Method -> 9]