I am not sure what you want for a “symbol”.
First, eval only works on top level, so only global variables are reachable. f(1) will assign 1 to global variable y.
y = 0
f(1)
println(y) # => 1
If you want eval to work on literal symbols, Meta.quot is needed.
function q(x)
quote y = $(Meta.quot(x)) end
end