I'm not exactly sure what you are trying to do, but why don't you just wrap program.jl as a function program(x), that is then called with the x you need and constructs M accordingly?
- [julia-users] Evaluating a function when a julia file is includ... user00
- [julia-users] Re: Evaluating a function when a julia file ... Nils Gudat
