I want to use mu own package. This is the procedure I take:
1) In Mathematica notebook I put the following code taken from code
BeginPackage["SOPackage`"];
AddTwo::usage =
"AddTwo[\!\(\*StyleBox[\"a\", \"TI\"]\), \!\(\*StyleBox[\"b\", \"TI\
\"]\)] returns \!\(\*StyleBox[\"a\", \"TI\"]\)+\!\(\*StyleBox[\"b\", \
\"TI\"]\).";
DotTwo::usage =
"DotTwo[\!\(\*StyleBox[\"a\", \"TI\"]\), \!\(\*StyleBox[\"b\", \"TI\
\"]\)] returns \!\(\*StyleBox[\"a\", \"TI\"]\)*\!\(\*StyleBox[\"b\", \
\"TI\"]\).";
AddTwo::argnum =
"AddTwo was called with `1` arguments. It expected 2.";
DotTwo::argnum =
"DotTwo was called with `1` arguments. It expected 2.";
Begin["`Private`"];
AddTwo[a_, b_] := a + b
AddTwo[args___] := (Message[AddTwo::argnum, Length[{args}]]; $Failed)
DotTwo[a_, b_] := a*b
DotTwo[args___] := (Message[DotTwo::argnum, Length[{args}]]; $Failed)
End[];
EndPackage[];
2) Go to SaveAs SOPackage.m
3) Put the file in $UserBaseDirectory/Applications
4) load the package with << SOPackage`
The problem is that nothing is loaded (I checked with Names["SOPackage`*"]). How to do this right?
I am using Mathematica 10.1 on Linux.
Names["SOPackages`*"]
, while it should've beenNames["SOPackage`*"]
. Could it be just a simple typo? $\endgroup$