New answers tagged rule
2
votes
Accepted
Delayed rule at StringReplace
Yes, RuleDelayed has the attribute HoldRest, which means that the rule isn't evaluated before evaluating the whole ...
0
votes
Accepted
Same code behaves differently as a pure function and a function, and insider another function
That's due to the renaming mechanism of nested scopings.
When evaluating Transformer2[algebra_] := , the local variable algebra ...
0
votes
Same code behaves differently as a pure function and a function, and insider another function
This doesn't really seem to have to do with Function versus SetDelayed, so it might warrant a separate question. Rather then ...
6
votes
Accepted
How to force Mathematica to simplify in terms of half angles?
Clear["Global`*"]
expr = Sinh[x]/(Sqrt[2] Sqrt[1 + Cosh[x]])
(expr /. x -> 2 θ // TrigExpand //
Simplify) /. θ -> (x/2) // PowerExpand
Sinh[x/...
3
votes
Smart way to remove rules from lists, leaving just values, specifically from FindMinimum output
We could also employ a deconstructing function:
f[a_?NumericQ] := a
f[a : {__Rule}] := Last /@ a
Examples:
...
Top 50 recent answers are included
Related Tags
rule × 342replacement × 184
pattern-matching × 55
list-manipulation × 53
simplifying-expressions × 23
functions × 18
associations × 16
expression-manipulation × 15
evaluation × 14
equation-solving × 13
syntax × 12
string-manipulation × 11
assignment × 10
calculus-and-analysis × 9
symbolic × 8
plotting × 7
differential-equations × 7
function-construction × 7
matrix × 6
programming × 6
summation × 6
core-language × 6
scoping × 6
argument-patterns × 6
filtering × 5