Error, attempting to assign to ... which is protected
Description
Examples
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.
Example 1 To verify that a name is protected, use the type(expr,protected) calling sequence.
type⁡a,protected
false
Example 2
If the name is protected, the command returns true.
type⁡sin,protected
true
Example 3
You can protect names using the protect command.
protect⁡myprotectedname
myprotectedname≔2
Error, attempting to assign to `myprotectedname` which is protected
Note: Use quotes to prevent evaluation of the name myprotectedname.
Example 4
You can remove protection from a name with the unprotect command.
unprotect⁡myprotectedname
myprotectedname:=2
See Also
protect
type/protected
unprotect
Download Help Document