ob-julia
ob-julia copied to clipboard
Possible bug with new orgmode version?
At the REPL:
julia> run(`echo a`)
a
There's no problem. But in emacs...
#+BEGIN_SRC julia
run(`echo a`)
#+END_SRC
Gives:
ERROR: MethodError: no method matching start(::Void)
Closest candidates are:
start(!Matched::SimpleVector) at essentials.jl:258
start(!Matched::Base.MethodList) at reflection.jl:560
start(!Matched::ExponentialBackOff) at error.jl:107
...
Stacktrace:
[1] #writedlm#18(::Array{Any,1}, ::Function, ::IOStream, ::Void, ::Char) at ./datafmt.jl:673
[2] #20 at ./datafmt.jl:683 [inlined]
[3] open(::Base.DataFmt.##20#21{Array{Any,1},Void,Char}, ::String, ::String) at ./iostream.jl:152
[4] #writecsv#23(::Array{Any,1}, ::Function, ::String, ::Void) at ./datafmt.jl:705
[5] writecsv(::String, ::Void) at ./datafmt.jl:705
Any ideas?
a = run('echo a') typeof(a) = Void
The problem is that ob-julia tries to format the output with writecsv, that cant work with lot of types. Void included. I think I'm forking this and trying to fix this, see #2
Thanks for the information.
I've just changed the src block header to interpret output as verbatim (:results output). This bypasses type formatting. And I think I could use :noweb to pass values from different src blocks if needed.
I have the same problem:
print("hello")
ERROR: MethodError: no method matching start(::Void)
@Adrianzo : did you push your fix?
There's no fix. That's why the issue is open.
You can only avoid the bug. Try adding #+PROPERTY: header-args:julia :results output
to your orgmode document. Else change only the problematic src code block header variable :results output
.
Thanks @Adrianzo ! The second method of adding :results output
worked. The first one gave the same issue when I first ran it and now it works too.