Sorry , I missed this reponse...
> $ julia MajorCalculations.jl configuration.txt data.txt
Well, you can certainly run it like that, even if this is a package. You
would write code to handle the parsing of the command line arguments
(potentially using ArgParse.jl) .. As I said, a package is primarily a unit
of code that can be shared and installed easily. The module load part is
useful, but not necessary.
But if you want to run it from within other julia code, and thus want to
import this functionality with "using MajorCalculations" then there are a
couple of options. There is an `__init` funcition that you can define, that
runs every time the module is loaded. You could use that, but you cant pass
parameters to it. In that case, you could write an external `init`
function. So this would be something like
using MajorCalculations
init("config.txt")
run("data.txt")
.. or something like that
On Monday, 23 February 2015 15:30:26 UTC, Marc Gallant wrote:
>
> Thanks for your input. I have some questions about your reply:
>
> 4. Yes, putting constants in global scope is fine. I believe there will
>> not be a performance issue is you mark the variables as "const"
>>
>
> How do I load the configuration file if Major Calculations is a package?
> "using MajorCalculations" won't work because MajorCalculations.jl requires
> a configuration file to define constants. And how to I pass the data to
> MajorCalculations.jl?
>
> For example, if MajorCalculations is my "main" file, I would like to write
>
> $ julia MajorCalculations.jl configuration.txt data.txt
>
> But how does this work in conjunction with "using" or "import"
> MajorCalculations?
>
> Thanks.
>