Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Imported normalize (but not exported it to match package conventions …
…in Julia)
- Loading branch information
dbcc6b0
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.
importing will still extend the method from base and change the behavior of other code
dbcc6b0
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.
Even if I don't export those methods?
dbcc6b0
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.
Correct. If you import it from Base and define a new method, it's extending the Base version of
normalize
- http://docs.julialang.org/en/release-0.4/manual/modules/?highlight=import.The best practice of avoiding "type piracy" is either define method names that aren't in Base on types that are in Base, or extend method names that are in Base on type signatures where at least one of the inputs is of a type defined in your package.
dbcc6b0
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.
It's an easy mistake to make, and a somewhat confusing topic. Some related discussion on a similar case here rened/FunctionalData.jl#3