#632 - Namespace conflict with TaylorSeries.update! #667
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #632.
The problem here was that both
ProgressMeter
andTaylorSeries
exportupdate!
, so we had to useimport
instead ofusing
for one of those packages.Since we use
ProgressMeter.update!
but notTaylorSeries.update!
, I thought that we should useimport TaylorSeries
and explicitly add the functions fromTaylorSeries
that we use.While trying this, I discovered an issue with
Requires
which I want to share here.TaylorSeries
also exportsnormalize_taylor
, but that function only becomes visible after loadingIntervalArithmetic
viaRequires
. This can be seen as follows:So I tried the following in
Reachability
:While this works perfectly in the REPL, loading this from within a module crashes in the precompilation. The reason is that
Requires
defers the loading to a queue and processes that queue only after the current command. Since "the current command" here is "precompile the module", the precompilation must finish before the extra code is loaded. And this means thatTaylorSeries.normalize_taylor
is not visible at that time. (This can be tested by adding a print output to the@require
command inTaylorSeries
.)So I ended up with
import ProgressMeter
and writingProgressMeter.update!
everywhere. Note that ultimately there is no way around this andusing MyPackage
is only a convenience functionality to avoid spelling out the package in most cases.