ecl-logo Documentation

OptionDefault

OptionDefault[OptionValue[functionName,ops,optionName]]out

pulls the value of optionName for function functionName given options ops. If the value in ops does not match the pattern defined in the Usage rules, it returns the default value defined in the Usage rules.

OptionDefault[OptionValue[functionName,optionName]]out

pulls the value of optionName for function functionName.

OptionDefault[OptionValue[optionName]]out

is equivalent to OptionValue[functionName,ops,optionName] when called inside of a function functionName with options ops.

Details

    Input
    Output
    General Options
    Attributes
  • HoldFirst

Examples

Basic Examples  (3)

Returns the default value of A:

Returns the default value of A:

Returns the value of A specified in the input options:

Additional Examples  (3)

Specified options can have extra layers of listing:

Specified options can be a sequence:

Extract values for multiple option names:

Options  (3)

Hold  (1)

Return the option value unevaluated and held:

Verbose  (2)

Use Verbose option to quiet the Pattern message:

Use Verbose option to quiet the UnknownOption message:

Attributes  (1)

HoldFirst  (1)

Return the option value unevaluated and held:

Messages  (3)

Pattern  (1)

Given an option value that does not match the Usage rules pattern:

UnknownOption  (2)

Throw message and return Missing["Option",optionName] if option is not in Usage rules but is specified in options:

Throw message and return Missing["Option",optionName] if optionName is not an option for function: