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$Packagesafter kernel launch? And in$ContextPath? – Kuba May 04 '17 at 08:41$Packagescontains context that were exported so ifMyPackwas loaded thenProgetto`should be there. – Kuba May 04 '17 at 08:50