I typed iex at the command line and now I am in the Elixir shell. I set x = "something", y = "something else" and so on. Then I go out for lunch and when I come back I want to see all the variable that are set in the shell. How can I do this?
x = "something"
y = "something else"
Curious, why would you want to do this? What pragmatic purpose does it serve?
Let's say that I was in the middle of a complex operation when I was interrupted and I want to resume my state and remind myself of where I am.
binding() is what you are looking for. For example:
iex(1)> a = 1
iex(2)> b = 2
[a: 1, b: 2]
This works in the context of any elixir code.
Thanks - perfect. And because you are famous, I'm also honored