Re: [julia-users] Re: workflow recommendation/tutorial

2015-01-26 Thread Tamas Papp
Thanks to everyone for the replies. So do I understand the following correctly: if I separate my functions and runtime code (eg MyModule and MyModuleRun), and then want to redefine a single function in the first, then I have to reload the whole module again? Julia seemed so ideal for exploratory

Re: [julia-users] Re: workflow recommendation/tutorial

2015-01-26 Thread Tamas Papp
So the only the global name space is for tinkering (iterative, interactive development), and modules are for more-or-less stable code --- is this correct? Is this an inherent feature of the architecture of Julia, or can one expect this to change as issues (especially #265) are resolved? Best,

Re: [julia-users] Re: workflow recommendation/tutorial

2015-01-26 Thread Tim Holy
You can redefine a function like this: function MyModule.myfunction(args...) stuff end Two caveats: - myfunction has to already exist in MyModule for this to work---you can't add new names to an already-closed module. - Anything that has already been compiled and uses myfunction won't

Re: [julia-users] Re: workflow recommendation/tutorial

2015-01-26 Thread Tamas Papp
Where is the API for this functionality exposed, so that eg ESS could make use of it? For example, how would one eval or define new functions into a module in the REPL? Best, Tamas On Mon, Jan 26 2015, Mike Innes mike.j.in...@gmail.com wrote: It's not an inherent feature of Julia, no, just a

Re: [julia-users] Re: workflow recommendation/tutorial

2015-01-26 Thread Mike Innes
It's not an inherent feature of Julia, no, just a tooling thing. Juno, for example, will allow you to eval directly into modules just fine, including defining new functions, replacing them, evalling `include`s, and replacing the module wholesale in order to get around type redefinition issues and

[julia-users] Re: workflow recommendation/tutorial

2015-01-26 Thread David van Leeuwen
Hi, Everyone seems to agree on the same workflow, so I'll just mention my workflow as an alternative. Pros: - don't need any Julia REPL restarts - don't need to prepend module name in (interactive) code. - variables, data structures etc all are retained during development. Cons: - in

Re: [julia-users] Re: workflow recommendation/tutorial

2015-01-26 Thread Mike Innes
Jewel.jl handles all the code analysis/eval related stuff. I don't know ESS that well but it shouldn't be hard to make use of it if someone wants to. In a nutshell it's basically as simple as calling `eval(Base, :(foo() = 1))`, but there's a few other things to think about like making sure Julia

Re: [julia-users] Re: workflow recommendation/tutorial

2015-01-21 Thread ggggg
I do basically the same thing Tim described, but I use julia -L mymoduletests.jl when I start julia. -L executes the file, then drops to the REPL in state after execution. The slowest part about the process is usually loading PyPlot. On Wednesday, January 21, 2015 at 5:29:04 AM UTC-7, Tim

[julia-users] Re: workflow recommendation/tutorial

2015-01-21 Thread Gray Calhoun
I just want to thank everyone who replied to this thread. These details are really helpful. On Tuesday, January 20, 2015 at 12:25:30 PM UTC-6, Gray Calhoun wrote: Seconded. If anyone has time to just record a 5 minute screencast of working productively in Julia I think he or she would have a

Re: [julia-users] Re: workflow recommendation/tutorial

2015-01-21 Thread Tim Holy
Sure, want to add it to the FAQ? --Tim On Tuesday, January 20, 2015 08:27:06 PM Viral Shah wrote: Should we capture this in the documentation somewhere? This is generally a useful set of hints for newcomers. -viral On Wednesday, January 21, 2015 at 5:38:29 AM UTC+5:30, Tim Holy wrote:

[julia-users] Re: workflow recommendation/tutorial

2015-01-20 Thread Gray Calhoun
Seconded. If anyone has time to just record a 5 minute screencast of working productively in Julia I think he or she would have a moderately sized but very appreciative audience. On Tuesday, January 20, 2015 at 4:45:13 AM UTC-6, Tamas Papp wrote: Hi, I am wondering what the best workflow is

Re: [julia-users] Re: workflow recommendation/tutorial

2015-01-20 Thread Jameson Nash
My workflow is very similar. I'll add that I'll make a throwaway module (MyModuleTests) so that I can use using in the test file. Doing this at the REPL (defining a new module directly at the prompt) is also a nice way of encapsulating a chunk of code to isolate it from existing definitions

[julia-users] Re: workflow recommendation/tutorial

2015-01-20 Thread Viral Shah
This is pretty much the workflow a lot of people use, with a few julia restarts to deal with the issues a) and b). I often maintain a script as part of my iterative/exploratory work, so that I can easily get to the desired state when I have to restart. -viral On Tuesday, January 20, 2015 at

Re: [julia-users] Re: workflow recommendation/tutorial

2015-01-20 Thread Viral Shah
Should we capture this in the documentation somewhere? This is generally a useful set of hints for newcomers. -viral On Wednesday, January 21, 2015 at 5:38:29 AM UTC+5:30, Tim Holy wrote: Agreed there are advantages in putting ones test script into a module. There is also at least one

Re: [julia-users] Re: workflow recommendation/tutorial

2015-01-20 Thread Tim Holy
My workflow (REPL-based, Juno in particular is probably different): - Open a file (MyModule.jl) that will consist of a single module, and contains types code - Open a 2nd file (mymodule_tests.jl) that will be the tests file for the module. Inside of this file, say `import MyModule` rather than