Let there be a list,
Sample={{{1, 2, 3}, {a, b, c}}, {{2, 3, 4}, {d, f, g}}}
I want to go to individual sublists and do some operation on it.I tried a few things like rule and replace.
sam /. {x_, y_} -> {x -> {a_, b_} -> {a + b}, y /. {w_, e_} -> w^e}
but I get
{{{1, 2, 3}, {a, b, c}} -> {a_, b_} -> {a + b}, {{2, 3, 4}, {d, f, g}}}
But I am not getting to individual lists. I want to use only rule or replace.
Edit: To make my question more clear I want to specify that I am not interested in one particular list operation. My idea is to be able to traverse sublists using Rule or Replace and then work on it.
My expected result is like
{{{1 + a, 2 + b, 3 + c}}, {2^d, 3^f, 4^g}}
sam /. {x_List, y_List} :> {Total[x], y[[1]]^y[[2]]}I am not sure, the expected result would help. – chuy Jul 18 '13 at 20:13sam /. {x_, y_} -> {x -> {a_, b_} -> {a + b}, y /. {w_, e_} -> w^e}makes no sense to me. – DavidC Jul 18 '13 at 21:42RuleDelayed:sam /. {x_, y_} :> {x /. {a_, b_} :> {a + b}, y /. {w_, e_} :> w^e}? (And a/.in place of one of the->.) – Michael E2 Jul 18 '13 at 23:27sam /. {x_, y_} :> {x /. {a_, b_} :> {a /. {g_, h_, f_} :> {g^g + h^h}}, y /. {w_, e_} :> w^e}– Pankaj Sejwal Jul 19 '13 at 04:18