SyntaxInformation

SyntaxInformation[f]
gives information used to generate syntax coloring and other advisories when is entered as input.

DetailsDetails

  • SyntaxInformation[f]={"prop1"->data1, "prop2"->data2, ...} defines syntax properties for f.
  • Possible properties include:
  • "ArgumentsPattern"patterns for the sequence of allowed arguments
    "LocalVariables"type and allowed positions of local variables
    "ColorEqualSigns"argument positions for which should be colored
  • The setting for is of the form , where the can be , , , , OptionsPattern[], or .
  • If the setting for specifies that f takes options, then valid option names are determined from Options[f].
  • The setting for is of the form . Possible types include "Table", , , , , . and give the minimum and maximum argument positions at which the variables can appear. can be Infinity.
  • A setting for of specifies that local variables that appear inside Dynamic should not be specially colored.
  • The setting for is of the form .

ExamplesExamplesopen allclose all

Basic Examples (2)Basic Examples (2)

Specify that should take exactly two arguments:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input

Set up options for :

In[1]:=
Click for copyable input

Specify that should have two arguments, followed by options:

In[2]:=
Click for copyable input

Inappropriate options are colored red:

In[3]:=
Click for copyable input
New in 6
New to Mathematica? Find your learning path »
Have a question? Ask support »