With::lvw
Details
-
- This message is generated when the first element in With is not a list of assignments to symbols.
- You can use Block or Module to introduce local variables without assigning values to those variables.
- Current versions of the Wolfram Language do not support local variables that are not symbols.
- Off[message] switches off the message; On[message] switches it on. For example: Off[With::lvw].
Examples
Basic Examples (2)
This input generates a message because the first element in With is not a list of assignments to symbols. The expression x[0] is a normal expression rather than a symbol:
With[{x[0]}, x[0] = 2;1 + x[0]]Correct use of With requires a list of assignments to symbols:
With[{x0 = 2}, 1 + x0]This message will also be generated if the first element in With is a list of strings:
With[{"package"}, 2 + 2]