I have asked this question on Slack, no solutions from there, so putting it up here.
The situation is,
Let’s say I’ve typed in the iex shell alias Asdf.Qwer, but actually what I need now is simply Qwer , I have no way to clear Asdf.Qwer because alias Qwer just again gives me Asdf.Qwer . So am I forever stuck with that? Or is there a way to reset/delete aliases
In other words, Qwer is now forever referring to Asdf.Qwer because of my mistype, and there is no way to delete/say that I don’t want this anymore. Or is there?
(P.S. an unrelated question, is the source code of Elixir Forum available as open source somewhere? It’s a great interface and I admire it very much.)
Thanks, but I don’t want to clear all variable bindings I have currently declared so far and am working on something. (Otherwise just ctrl-C twice out from the shell and coming in back again would have been done.)
Reason I’m asking is to see whether this possibility is already there, just that I don’t know the way how-to.
And Erlang’s shell did have an f() / f(variable) function that cleared the binding (for all/a variable), so I just want to find out if there’s something along the same idea in Iex.
Hmm, funny, it seems that you can overwrite alias in some cases and can’t in other cases. I’ve played with this:
iex> alias Asdf.Qwer
# still not working
iex> alias Qwer
iex> alias Qwer, as: Qwer
# this works?
iex> alias Foo, as: Qwer
# this also works
iex> alias Bar.Qwer
# funnily, this seemed to work at first glance (but really doesn't)
iex> alias Elixir.Qwer
Qwer # refers Qwer, yeay!
Bar.Qwer # it reverts, the alias doesn't work.