Usually the solution is the wrap your code in a module, so your file would
look like:

module A
<your code here>
end

Then at the REPL you do include("bin/myscript.jl") and it will replace the
module.  Keep the name short so when you call your methods you only have to
do "A.mymethod()", or throw in an "export mymethod" after the "module A"
line.

You'll get used to the workflow, and of course for some scripts it's fine
to just restart the REPL if you're too lazy to wrap it as a module.

On Sun, Feb 14, 2016 at 9:51 PM, Wilton Basse <[email protected]>
wrote:

> So I write a script in text editor, save into ~/bin/myscript.jl.  Then in
> REPL use include("bin/myscript.jl") to run and test in REPL.
> Hmmm, see some changes to make, go back to text editor and edit and save
> changes.
>
> Here's the question: When I go back to REPL to test, how do I make sure I
> have *only* the most recent edit loaded?  If I do include() again is the
> old version replaced?  Do I need to "un-include" the old version somehow?
>
> I have been closing and re-opening the REPL and re-doing include(), but
> that's really unwieldy, especially using multiple scripts, plus I end up
> losing previous work within REPL.
>
> Thanks!
>

Reply via email to