Hello list:

I'm trying to access variables via a list of atoms,

So given:
iex> a = 1
...> b = 2
...> c = 3
...> vars = [:a, :b, :c]

I would like to print the value in each variable
...> for var <- vars, do: IO.inspect(var)

How can I achieve this

I have tried this to no avail

iex> quote(do: var!(a)) |> Code.eval_quoted 
** (CompileError) nofile:1: expected variable "a" to expand to an
existing variable or be part of a match (elixir) expanding macro:
Kernel.var!/1 nofile:1: (file)


thank you.

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-talk/20160714223146.3fc22245.eksperimental%40autistici.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to