I have functions defined inside a Begin Block of a Package in the normal manner (BeginPackage ... foo::usage="bar" ... Begin ... DegreesPerMeterAtmosphere[targelevdeg,startalt]: = targelevdeg+startalt ... etc.)
I tried to define variables that would be exposed by the packaged (as below) - but it does not work and I can't find the correct comments ion the manuals. This is the simplified code:
BeginPackage[ "FoundationFunctions`"]
speedlight::usage = "The speed of light in meters/sec";
DegreesPerMeterAtmosphere::usage = "DegreesPerMeterAtmosphere[targelevdeg,startalt] stuff"
Begin[ "Private`"]
speedlight:=299792458 (* m/s *);
DegreesPerMeterAtmosphere[targelevdeg_,startalt_]: = targelevdeg+startalt
End[]
EndPackage[]
But when I Get[] the package from a Notebook the function is pulled across but not the variable. Specifically Names["FoundationFunctions`*"] yields {"DegreesPerMeterAtmosphere"}.
Am I trying to do something that is silly (perhaps one cannot use packages to define/ encapsulate variables)? Or have I done the right thing in the wrong way?