Closed DanGrayson closed 4 years ago
Why is it strange? ConwayPolynomials
is one of the preloaded packages, so the package object is defined, and loadPackage
automatically sets Reload => true
if the input is a package object, which is rather handy.
This behavior is documented as well:
Reload => a Boolean value, default value null, whether to reload the package, if it has been loaded before. If the input was an already loaded Package, this is automatically set to true.
Why is it strange?
ConwayPolynomials
is one of the preloaded packages, so the package object is defined, andloadPackage
automatically setsReload => true
if the input is a package object, which is rather handy.This behavior is documented as well:
Reload => a Boolean value, default value null, whether to reload the package, if it has been loaded before. If the input was an already loaded Package, this is automatically set to true.
On second thought, it might be okay, because the sort of bug that is prevented by having loadPackage refuse to reload a package unless it was clearly intentional is the following: the user puts code such as loadPackage "Foo"
into a package. Typically Foo is not already loaded, which is why Foo has to be given as a string here. The feature under discussion doesn't affect that.
It's odd that loadPackage agrees to reload a package if given the package object rather than the name: