[Date Index] [Thread Index] [Author Index]
Contexts and Naming of Things
I have the following code which does not work as I had hoped. I first declare a function in a package... BeginPackage["HSSV`cavity`"] foo::usage = "now is the time..." Begin["`Private`"] bar; nebbish; foo[x_, y_] := 1 /; y === bar; foo[x_, y_] := 2 /; y === nebbish; End EndPackage And then try to run the following simple commands... foo[1, bar] foo[1, cavity`bar] foo[1, HSSV`cavity`bar] I had thought that the first one would have given me the correct answer, as it works OK when I do not embed the function definition in a package. The others were desperate second efforts that also failed. What am I missing here?