var array = ['x', 'y', 'z'],
expression = "x+y+z";
var scope = new Scope(array);
var result = eval('with(scope){' + expression + '}');
alert(result);
function Scope(array){
this[array[0]] = 1; // x=1
this[array[1]] = 2; // y=2
this[array[2]] = 3; // z=3
}