Given a list of symbols syms={x,y}, I want to assign it a list of values.
Of course I can write:
x =.; x = 4711; Print[x];
y =.; y = 4712; Print[{x, y}];
4711
{4711,4712}
Or:
x =.; y =.;
{x, y} = {711, 712}; Print[{x, y}];
{711,712}
But I cannot write (well, I can, but it does not assign x and y):
x =.; y =.; syms = {x, y}; Print[syms, ", ", {x, y}];
syms = {11, 12}; Print[syms, ", ", {x, y}];
{x,y}, {x,y}
{11,12}, {x,y}
I think I understand the latter. Now I try with SymbolNames. This gives errors which I don't understand.
x =.; Symbol["x"] = 11; Print[x];
Set::write: Tag Symbol in Symbol[x] is Protected.
x
What I really want is something like:
x =.; y =.; symNames = {"x", "y"}; Print[symNames // InputForm];
(Symbol /@ symNames) = {1, 2}; Print[{x, y}];
{"x", "y"}
Set::write: Tag Map in Symbol/@{x,y} is Protected.
{x,y}