If I have the following function:

function foo(k,v)
    @eval ($(symbol(k))=$v)
    println(bar)
end


and I call it with:

foo("bar", 5)

then the global variable bar is set to 5 and the function prints 5.

Is there any way to make @eval set a local variable inside foo instead?  (I 
tried prefixing the assignment with local which didn't work).

thanks,
deniz

Reply via email to