ecl-logo Documentation

ReplaceRule

ReplaceRule[ listOfRules, newRule ]newListOfRules

replaces in listOfRules all rules of the form Rule[a,_] or RuleDelayed[a,_] with newRule.

ReplaceRule[ listOfRules, newRules ]newListOfRules

replaces in listOfRules all rules whose left hand sides match rules in newRules.

Details

  • This can be used to replace parts of SLL info, such as updating peaks in info
  • Default is to replace only at level 1, but can use Level option to go deeper.
  • Input
    Output
    General Options

Examples

Basic Examples  (3)

Replace a single rule:

Replace a list of rules:

Like ReplaceAll, the first matching rule is used:

Options  (1)

Append  (1)

Indicate if rules not in the current list should be appended to the updated list: