In the process of iterating through lots of toy economic models and writing small scripts to analyze them (make plots, etc.).
I’ve gotten into the following workflow, and I’m wondering if (a) it’s reasonable (b) Other people share it and (c) if other people have formalized it into a package.
The workflow attempts to balance the ease of running a script at the REPL with
] generate MyModelbecause ultimately I will want things in a package
] adda bunch of packages
- Write my functions inside the
- Write a
- In the REPL, run
using Revise; using MyModel; exportall(MyModel). The last command sends all names to
mainlook like this
function main() @eval Main begin # everything available at the REPL ... end end
- Go to
src/MyModel.jland copy and paste all the
usingstatements into the REPL so that everything is available at the REPL.
main()at the REPL. Everything inside
@infiltrateextensively while debugging.
The reason for
@eval is so that I can take things inside
main and easily spit them out into helper functions that are also in the
This gives me the best balance of having a package and having stuff accessible at the REPL.
Anyone else do this? I use Sublime Text and a terminal, btw.