General::write

Details

  • This message is generated by an attempt to assign a value to a protected symbol.
  • A symbol s is protected if Attributes[s] includes Protected.
  • An assignment tag is the symbol to which an assignment attaches an evaluation rule.
  • A function::write message can be generated indirectly by any function that makes assignments.
  • Off[message] switches off the message; On[message] switches it on. For example: Off[General::write].

Examples

Basic Examples  (3)

An error occurs because the expression 3x on the left-hand side of the assignment is a product (an expression with a head of Times). The symbol Times is protected.

The same message is generated if this assignment occurs within another expression:

Equations are entered using lhs==rhs rather than lhs=rhs:

The use of k+1 as an iterator generates an error when Do tries to assign a value to that iterator: