I have a group of Packages that I use to create a lot of other Packages. Let's see an example:
BeginPackage["testPack`",{"auxPack01`","auxPack02`","auxPack03`","auxPack04`"}]
testFunc::usage="testFunc[]"
Begin["`Private`"]
(*...package code...*)
End[]
EndPackage[]
My question is:
How can I create an auxPack (or some other simplification) so, I can just call it, instead of auxPack01, auxPack02 ... or a variable with all the definitions?
I tried to create a variable
$auxPacks={"auxPack01`","auxPack02`","auxPack03`","auxPack04`"}
So I could call
BeginPackage["testPack`", $auxPacks]
But didn't work. I also tried to create my own BeginPackage function as:
myBeginPackage[packName_String]:=BeginPackage[packName,{"auxPack01`","auxPack02`","auxPack03`","auxPack04`"}]
But didn't work either.
Something similar this last try would be the best option to me. Any clue?
$auxPacksormyBeginPackageneeds to live in some context, which needs to be on$ContextPathwhen loading package. – jkuczm Dec 29 '14 at 13:15BeginPackage["auxPack`",{"auxPack01`", ...}]; EndPackage[]and then callBeginPackage["testPack`", "auxPack`"]– jkuczm Dec 29 '14 at 13:18