The main difference that I'm aware of is that the script contents run in the global address space, whereas the contents of the function have the function's address space. One consequence is that the compiler knows more about the function's address space, since it's closed, and can therefore do more optimizations. (From the way you're coding, it sounds like you were probably aware of this already, maybe?)
However, without seeing your script, it's hard to judge if that's actually the cause of your problems, or if it is something else. Would you be willing to share your script? Another thought would be to try to run it on 0.3 (which you should probably upgrade to anyway, as it has tremendous improvements over 0.2.1). Cheers, Kevin On Fri, Aug 29, 2014 at 4:40 AM, RecentConvert <[email protected]> wrote: > How does Julia treat an inputless function as compared to a script with > the same contents? > > Normally I create a function by first coding it as a script as it's easier > to access the variables for testing. Once that is done I do the simple > conversions to a function. Unfortunately in this case it changed the > outcome of the code. If I comment out the function line and it's > corresponding end then the code works as it should. If I put them back in > it fails. > > The script itself sequentially loads files in groups and averages the data > within before saving the averaged data to a new file. > > Julia 0.2.1 > Windows 7 64-bit > *Packages Used* > > - DataFrames > - Datetime (I know, Dates exists but I haven't had time to make the > update) > > >
