Original Question: I used the convert command before loading the Units package.
Convert[20000. Feet, Mile]
Since Convert
isn't defined, it returns unevaluated. Now if I load the units package, the function evaluates, but the symbols Convert
, Feet
, and Mile
are highlighted in red by the front-end:
Needs["Units`"]
(* Convert::shdw: Symbol Convert appears in multiple contexts {Units`,Global`}; definitions in context Units` may shadow or be shadowed by other definitions. >> *)
Convert[20000. Feet, Mile]
(* 3.78788 Mile *)
I know I could restart the kernel and load the package, but how else can I proceed at this point to get rid of the shadowed definitions and make everything work properly?
I tried Remove[Convert,Mile,Feet]
, but then Convert
no longer works (expected), then I tried reloading the package, but the command still doesn't work.
Fix for my problem: According to the helpful comments and the answer by @Szabolcs, it seems my mistake was not paying attention to the context of the symbols that were shadowed. The following code shows one way to solve the issue I encountered: