Yes, it is a possibility, as I wrote above: "Maybe the solution is to 
pre-process the Julia code to be evaluated, to handle print() and 
multi-line input in several parse() calls." It is not trivial. The print 
calls don't produce results, so I have to redefine print() and println(). 
We need to break up the code to be pasted to Julia as single-line commands, 
because parse does not handle multi-line code, etc. I was hoping that 
someone has already some Julia code that captures the console output, or 
can tell the trick. It does not seem to be the case.

On Saturday, June 28, 2014 7:14:05 PM UTC-6, Steven G. Johnson wrote:
>
> On Saturday, June 28, 2014 4:40:21 PM UTC-4, Laszlo Hars wrote:
>>
>> One application of it is my AutoHotkey macro for MS Word. It has three 
>> hotkeys. #1: takes the text from the caret backwards to a prescribed string 
>> (double space), and passes this to Julia, replacing the selection with the 
>> result.
>>
>
> Rather than using the REPL, wouldn't it be far easier just to write a tiny 
> Julia script that reads strings, executes them, and prints the result (or 
> puts it on the clipboard or whatever)?   e.g.
>
>
>       while true
>        println("RESULT: ", eval(parse(readline())))
>        end
>
> You could easily modify this with a try...catch block to catch exceptions 
> and do whatever you want with it, etcetera.      It seems like this would 
> be easier and much more flexible than hacking the REPL.
>

Reply via email to