Protect

Protect[s1,s2,]

sets the attribute Protected for the symbols si.

Protect["form1","form2",]

protects all symbols whose names match any of the string patterns formi.

Details

  • Protect allows abbreviated string patterns containing the following metacharacters:
  • *zero or more characters
    @one or more characters, excluding uppercase letters
    \\*, etc.literal *, etc.
  • Protect["context`*"] protects all symbols in a particular context.

Examples

open allclose all

Basic Examples  (1)

Define and protect a function:

In[1]:=
Click for copyable input

The function definition can no longer be changed:

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

Scope  (2)

Applications  (1)

Properties & Relations  (4)

See Also

Unprotect  Protected

Tutorials

Introduced in 1988
(1.0)