julia> count
count (generic function with 6 methods)
julia> count = 0
ERROR: cannot assign variable Base.count from module Main
Why is it that the function is not exported/defined until called? If one hasn’t call it, it gets overwritten in the namespace (Base.count is still available).
This is an interesting issue, I think it might be related to how it is impossible to “import” a method after it has been called first. For example, try making a call to + and then try importing + from another module. You will find that the import is only successful if you did not make a call to + first. I suspect this is by design, because otherwise issues would happen. This allows methods to be imported if they are unused, and locks them into dispatch after being used.