Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I list all shell variables in IEx?

I can't figure out how to view my current context in IEx. I want to see a list of all the variable that have been defined in the shell. Is this possible? Thanks.

like image 982
tadasajon Avatar asked Feb 07 '17 01:02

tadasajon


1 Answers

You can get the current variables and their values with binding()

e.g.

iex(1)> a = 2
2
iex(2)> b = %{c: 3}
%{c: 3}
iex(3)> binding()
[a: 2, b: %{c: 3}]

See h binding in IEx for more info.

like image 75
semanticart Avatar answered Sep 27 '22 21:09

semanticart