How to embed Julia in interactive mode

Amazing! It seems that when embedding, Base.active_repl_backend is not defined.

BUT I can use softscope() to do what I need. Behind the scenes I now wrap strings passed to jl_eval_string() with eval(Meta.parse(REPL.softscope(...))).Here’s an actual session in Stata using the revised Julia plugin.

. jl
------------------------------------------------ Julia (type exit() to exit) ----------------------------------------------------------------------------------------------------------------
jl> . S = 0
0
jl> . for i in 1:4
  ... S += i
  ... end
jl> . S
10
1 Like