gjkerns / ob-julia

36 stars 25 forks source link

Possible bug with new orgmode version? #9

Open Adrianzo opened 6 years ago

Adrianzo commented 6 years ago

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?

nico202 commented 6 years ago

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

Adrianzo commented 6 years ago

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.

emonigma commented 6 years ago

I have the same problem:

print("hello")
ERROR: MethodError: no method matching start(::Void)

@Adrianzo : did you push your fix?

Adrianzo commented 6 years ago

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.

emonigma commented 6 years ago

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.