Skip to content

Adding helper to reload elixir modules while in iex.#2

Open
khia wants to merge 1 commit intoyrashk:masterfrom
khia:features/reload
Open

Adding helper to reload elixir modules while in iex.#2
khia wants to merge 1 commit intoyrashk:masterfrom
khia:features/reload

Conversation

@khia
Copy link
Contributor

@khia khia commented Jul 20, 2012

Typical usage scenario is like follows:

    iex(1)> use Reload
    []
    iex(2)> reload [My.Awesome.Elixir.Module]
    [{:module,My.Awesome.Elixir.Module}]

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be ensure_loaded instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean:

  1. reload should be renamed into ensure_loaded. It shouldn't since reload also do purge so semantically it's more reload rather than ensure.
  2. Instead :code.load_file we should use unsure_loaded. In this case regular erlang modules couldn't be reloaded. Since internally module is represented as atom with __MAIN__ prefix erlang means of reloading works just fine.
  3. Instead of reload the one could use ensure_loaded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments