I want to aoutoload a package at the beginning of a notebook. I set up my directory as written here
How to use the Autoload directory?
So, I have these files:
../Work/MyFile.nb
../Work/Autoload/MyPack/MyPack.m
../Work/Autoload/MyPack/Kernel/init.m.
MyPack.m :
ClearAll["Progetto`*"];
BeginPackage[ "Progetto`"]
Prova::usage="Prova[]"
Begin["`Private`"];
Prova[]:=5+1;
End[]
EndPackage[]
init.m:
Get["MyPack`MyPack`"]
In MyFile.nb, I would like use Prova[]
, but the output isn't 6
but is Prova[]
.
Where am I wrong? Am I missing something in init.m
?
Progetto`
in$Packages
after kernel launch? And in$ContextPath
? $\endgroup$$Packages
contains context that were exported so ifMyPack
was loaded thenProgetto`
should be there. $\endgroup$