Skip to main content
4 votes

Transform a list of rules into a list of function definitions

rules = {f[x] -> a + 3 h[x], g[x] -> 2 a + c + 6 h[x]} ...
Craig Carter's user avatar
  • 4,665
4 votes
Accepted

How to achieve automatic nesting of pattern application

...
E. Chan-López's user avatar
3 votes

Transform a list of rules into a list of function definitions

To achieve this, we need to manipulate the "DownValues" of the function names. We use "Scan" to operate on all elements of the rule list. As "DownValues" has the ...
Daniel Huber's user avatar
  • 54.6k
2 votes

Transform a list of rules into a list of function definitions

If the left-hand sides of each rule depend on the same variable, @Craig Carter's solution is sufficient, but if not, we can generalize this process using ReplaceAll ...
E. Chan-López's user avatar
1 vote
Accepted

How to put prime before value during a substitution?

One approach to get your desired result, of course, is to just put the time dependence explicitly, ...
evanb's user avatar
  • 6,311

Only top scored, non community-wiki answers of a minimum length are eligible