On Sunday, June 29, 2014 12:34:33 PM UTC-4, Laszlo Hars wrote:
>
> Thanks, Steve. I did not know about "Base.parse_input_line". It can very
> well be the solution together with capturing STDOUT with redefining
> display(). My only concern is using an undocumented function. It may change
> or get removed.
>
That's true, but hacking the REPL is far more likely to break in future
releases.
Undocumented internal functions in Julia have a tendency to become
documented external functions when they prove useful outside of Base.
There is a reasonable case to be made for exporting and documenting
parse_input_line (although it might get renamed in the process). Maybe
open an issue?
(And you shouldn't redefine display; instead push something onto the
display stack as I explained above. For one thing, redefining display(x)
is not enough to work for code that explicitly calls display("text/plain",
x).)