Let us say we have two sets of symbols $(x, y, z)$ with the same names that live in two different contexts:
{context1`x,context1`y,context1`z} = {1, 10, 100}
{context2`x,context2`y,context2`z} = {2, 20, 200}
How can we define a function which takes as an argument a context name, adds $x$ and $y$ that live in the specified context and assigns the result to $z$ in the same context?
Example:
f["context1`"]
would result in
{context1`x, context1`y, context1`z} = {1 ,10, 11} {context2`x, context2`y, context2`z} = {2, 20, 200}