JuliaLang/julia — pull request #6413 by mbauman (2014-04-04 15:15:03+00:00)
Title: Make the REPL re-entrant and easier to debug

The two patches here simplify working with the REPL itself. The first allows for printing of REPL objects in the REPL. The second makes it re-entrant.

Previously, the keymap functions were assigned a name with the eval macro (that is - in global scope). This changes the keymap macro to instead return an anonymous function so that additional instances of the REPL don't clobber the previous keymap functions.

So, you can now start a second REPL inside the first. `Base.REPL.run_repl(Base.REPL.LineEditREPL(Base.Terminals.UnixTerminal(get(ENV,"TERM",""),STDIN,STDOUT,STDERR)))`. I've found this particularly useful for testing keybindings.

cc: @nolta @loladiro