I want to make Private functions.
From my point of view, being a Private function means that the function is not accessible from other packages. For that purpose I wrote the following code. But my private function can be called in another package. I don't want that.
(*Package 1*) BeginPackage["Test1`"]; Begin["`Private`"]; Test1`Private`function1[x_] := x End; EndPackage; (*Package 2*) BeginPackage["Test2`"] function2[x_] := Test1`Private`function1[x] EndPackage
As you can see from the above code,
function1 is a private function in
Test1. That same function when called in
Test2 is still accessible, but I don't want that.
How can I resolve this.
Can anyone help me?