How to create a package in WMathematica with private functions?

Can't deal with the context when creating the package. You must create a package with a Laundry list of features. Inside the package the desired utility functions. To do this, use the internal context. Begin[]; End[]

However, when activating the package, the function package cannot "see" internal function. Tried to use the context pointer, it has not solved the problem.

However, when connecting the package again, everything works. What is the error?

PS Sketched an example to demonstrate the problem. Make screenshots of the files.
5a927d6a6f02f639893192.png5a927d6f37bdb317841635.png
June 7th 19 at 15:39
1 answer
June 7th 19 at 15:41
Solution
One of the ways to solve the problem is to use relative context: `PR pB[d]

I usually do this:
1. before you begin the private context list all the public symbols (you still need usage and warnings to register)
2. definition of public characters doing in the same block where the private, that is, until the End[].
Because No. 1 public symbols don't capture the context, but within a private context it is clearly not to write.

Example:
BeginPackage["P`"];
b::usage = "My var b";
Begin["`Pr`"];
a = 2;
b := a;
End[];
EndPackage[];

In[9]:= OwnValues[b]

Out[9]= {HoldPattern[b] :> P PR a}
Ie, right?
- Write all the functions in private.
- Functions needed in the public prescription beginning with "usage" - Willie_McCullough41 commented on June 7th 19 at 15:44
That's what I do.
Symbols (not only functions) that need to be tied not to the private context, and by batch, you mention, at least in the list, at least using a semicolon.
BeginPackage["P`"];
{var1, var2, func1, func2};
Begin["`Pr`"];
BeginPackage["P`"];
var1;
var2;
func1;
func2;
Begin["`Pr`"];

The fact that the symbol is bound to the context where it was first mentioned. In this case, P`. - Ida_Goyet commented on June 7th 19 at 15:47
have got to organize my plug-in? - Ida_Goyet commented on June 7th 19 at 15:50
Yes , thanks for the help. - Willie_McCullough41 commented on June 7th 19 at 15:53

Find more questions by tags Wolfram