Error, attempting to assign to v7 which is protected - Maple Help

Home : Support : Online Help : Error, attempting to assign to v7 which is protected

Error,  attempting to assign to ... which is protected

 Description Note: For users of Maple 16 and earlier versions, this error message is displayed when you assign a value to a protected name. Most Maple systems names are protected by default. Protection is used to prevent names from being modified by the user. Names can be protected with the function protect, and protection can be removed with unprotect. It is not recommended that you unprotect Maple protected names. The calling sequence select(type, {unames(), anames(anything)}, protected) returns the set of protected names in Maple.

Examples

Example 1
To verify that a name is protected, use the type(expr,protected) calling sequence.

 > $\mathrm{type}\left(a,\mathrm{protected}\right)$
 ${\mathrm{false}}$ (2.1)

Example 2

If the name is protected, the command returns true.

 > $\mathrm{type}\left(\mathrm{sin},\mathrm{protected}\right)$
 ${\mathrm{true}}$ (2.2)

Example 3

You can protect names using the protect command.

 > $\mathrm{protect}\left('\mathrm{myprotectedname}'\right)$
 > $\mathrm{myprotectedname}≔2$

Note: Use quotes to prevent evaluation of the name $\mathrm{myprotectedname}$.

Example 4

You can remove protection from a name with the unprotect command.

 > $\mathrm{unprotect}\left('\mathrm{myprotectedname}'\right)$
 > $\mathrm{myprotectedname}≔2$
 ${\mathrm{myprotectedname}}{:=}{2}$ (2.3)