-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Improve docs for Code module
#14456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve docs for Code module
#14456
Conversation
lib/elixir/lib/code.ex
Outdated
| Code.get_compiler_option(:debug_info) | ||
| #=> true | ||
| iex> Code.get_compiler_option(:debug_info) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is reading global state and some tests may change this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I get it, with mix test it could be false. And put into it is even worse. Reverted, will be more careful with changes
lib/elixir/lib/code.ex
Outdated
| Code.put_compiler_option(:debug_info, true) | ||
| #=> :ok | ||
| iex> Code.put_compiler_option(:debug_info, true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. May affect global state. We should revert.
lib/elixir/lib/code.ex
Outdated
| iex> Code.loaded?(Atom) | ||
| true | ||
| Code.loaded?(Atom) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert this and use a module that is likely to already be loaded, such as Enum or String. Atom indeed may not be loaded.
|
💚 💙 💜 💛 ❤️ |
iex> Code.loaded?(Atom)gave race condition, at least localy.