Andrei,

Not sure if my way is better, but it seems to work ok for me. It is also biased 
towards OSX, although I know a similar approach has been used on other 
platforms (for R).

I have Julia's REPL window side by side to TextMate (or similar editor). I 
extended Julia's plugin for Textmate with 1 menu item, Command-R, in addition 
to Command-E. Command-E sends the current selection to Julia's REPL. This 
command has always been there I believe.

Command-R sends the entire file to the REPL by inserting an include("..."), 
mainly because Command-E creates too much clutter in the history.

Usually I'm editing a file and then re-submit it to the REPL by typing 
Command-R in the editor. Occasionally though this is not sufficient and one or 
more modules have to be reloaded as you point out.

I kill the REPL (Ctrl-D), now back in the shell, UP-ARROW will bring up 
something like 'clear; julia', RETURN starts a new version of the REPL, 
UP-ARROW again recalls the last command executed in the REPL, RETURN to execute.

Thus it takes a minimum of 5 key-strokes, sometimes a few more because I tried 
out some stuff in the REPL. In those cases CTRL-r is quite handy.

Works in my workflow, YMMV.  I think key is that restarting the REPL and 
loading the needed modules is fairly quick. While developing packages I have 
found that the restart time is usually easy to control. 

The other gotcha is that I usually have multiple terminals open, and need to 
ensure the REPL is the last used terminal. Again, in my case I've gotten used 
to it. Or on OSX I could probably find the REPL terminal in AppleScript and 
activate it. But I haven't been bitten enough to put in that effort.

Regards,
Rob J. Goedman
[email protected]




On Jul 7, 2014, at 2:39 PM, Andrei Zh <[email protected]> wrote:

> Thanks Tim, this is another interesting capability, and I'm definitely 
> looking forward to try it out in Julia REPL. It's a bit unusual though, so 
> I'm still looking for smoother way to work interactively. 
> 
> I checked one of popular packages (namely, Distributions.jl) and I like their 
> approach. They put all the code for related functionality into somefile.jl 
> without any bothering about modules, play around with it (redefine without 
> any problem) and then, when they are done, just include this file into 
> SomeModule. This is not what I've got used to in Python, but it still works 
> quite well. 
> 
> Anyway, further ideas for better interactive development are still welcome. 
> 
> 
> On Monday, July 7, 2014 12:27:09 PM UTC+3, Tim Holy wrote:
> On Sunday, July 06, 2014 02:52:45 PM Andrei Zh wrote: 
> > Is there any way to update definitions that where imported into Main with 
> > "using" statement? 
> 
> Not that I know of. https://github.com/JuliaLang/julia/pull/7487 may be of 
> interest to you. 
> 
> --Tim 
> 

Reply via email to