That's very strange; there are several things here that shouldn't happen.
First off, your "hello" test definitely won't work the way you expect: You define hello
with Set
(not SetDelayed
), so if everything is working as it should, you'll get the output of hello
once during package loading and then never again. If that's not what's happening, then the package wasn't loaded.
Secondly, hello
and v
live in the "Development"
context, they should not show up in "Global"
at all.
Could you try the following things and let us know what happens?
First, to find out if the package was loaded at all: Are hello
and v
marked in blue (i.e. as unknown symbols), or are they black? Did you do all of this on a clean Kernel, or were there possibly definitions of hello
and v
already floating around? Can you evaluate $ContextPath
both before and after trying to load the package (on a fresh Kernel), and let us know what it returns?
Also, can you try the following to see if Mathematica is really finding the correct package file at all? (Maybe there are other packages with the same name higher up on the path.)
FindFile["Development`"]
Does the package work if you put the notebook and the package into the same directory, SetDirectory
to that place, and then use Get["Development.m"]
? (i.e. load it with its file name rather than the context)
Your question title is specifically about Mathematica 10; did you have this problem with previous versions as well? (You mention having had this problem for years, so I assume it didn't appear with the last upgrade.) Have you experienced the problem on different installs, either when re-installing for some reason or on different computers?
Is this a problem you have with all and any packages, or just your own? Can you use built-in packages? Can you use third-party packages?
Is there any chance that there's something weird in your $UserBaseDirectory/Kernel/init.m
file? Does $Path
look okay?
(Also, not really a problem, but why do you set your directory to the package directory?)
Edit: Oh, one more minor thing: You forgot a context mark at the beginning of the Private context; it should be:
Begin["`Private`"]
(But your version didn't break the package for me when I just copied and pasted, so it's not the source of your trouble...)