Replace::reps ReplaceAll::reps ReplaceRepeated::reps ReplaceList::reps ReplacePart::reps

Details

  • This message is generated when the indicated expression does not have the expected form of a rule, a list of rules, or a dispatch table.
  • ReplaceAll[expr,rules] is usually entered as expr/.rules.
  • ReplaceRepeated[expr,rules] is usually entered as expr//.rules.
  • A rule is an expression of the form lhs->rhs or lhs:>rhs (Rule[lhs,rhs] or RuleDelayed[lhs,rhs]).
  • Dispatch tables are constructed using the Dispatch function.
  • Off[message] switches off the message; On[message] switches it on. For example: Off[Replace::reps].

Examples

Basic Examples  (1)

An error occurs because the expression on the right-hand side of /. is not a rule, a list of rules or a dispatch table:

This type of error frequently occurs following the failure of some other calculation. For example, the invalid FindRoot input here gives a result that is not a list of rules:

With correct input to FindRoot, the result will have the correct form for use in ReplaceAll: