For example, I have the equation
x^2 + y^2 == x*y
and I want to apply the rule
y -> s*x
I can do it easily by
x^2 + y^2 == x*y //. y -> s*x
But it seems to me it would be possible to use only Map to change everything.
How can I do it that way? In other words, I think Replace is just a kind of syntactic sugar, and want to know how to express Replace by Map.
Replaceis just a kind of syntactic sugar" - no. No, it's not. – J. M.'s missing motivation May 16 '13 at 02:00Map[f, {1, 2}]will apply the functionfon the elements of the list{1, 2}to yield{f[1], f[2]}. That wors differently fromReplace[{1, 2}, 1 -> 5, {1}]which replaces the1in{1, 2}with5, to yield{5, 2}. – J. M.'s missing motivation May 16 '13 at 02:22f[y]=s x; f[v_]:=v; Print[":("]; Map[f,x^2+y^2,Infinity]Might want to check outDownValues[f]to see that this in fact does not avoid rules. – ssch May 16 '13 at 02:24