Julia print commands not working in emacs org-mode

OK, it turns out that for :results value the following code is actually what is being executed if you study ob-julia.el:

writecsv("/tmp/babel-2072Vgu/julia-2072RSg", begin
    a=[1;2;3]
    b=[3;4;5]
    c=a+b
    print(c)
end)

The return value of print, which is nothing, is passed to writecsv which thus fails. And everything written to STDOUT is ignored as far as babel is concerned.

EDIT: See here for an explanation of why writecsv is called. I am not convinced this is the optimal function to call; really there should be a function (I think) that takes any julia value and writes it in the format orgmode expects, without using csv as an intermediary…

2 Likes