ob-julia icon indicating copy to clipboard operation
ob-julia copied to clipboard

Possible bug with new orgmode version?

Open Adrianzo opened this issue 7 years ago • 5 comments

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?

Adrianzo avatar Dec 15 '17 16:12 Adrianzo

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

nico202 avatar Dec 16 '17 11:12 nico202

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.

Adrianzo avatar Dec 21 '17 14:12 Adrianzo

I have the same problem:

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

@Adrianzo : did you push your fix?

mm3509 avatar Jun 04 '18 12:06 mm3509

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.

Adrianzo avatar Jun 04 '18 16:06 Adrianzo

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.

mm3509 avatar Jun 05 '18 08:06 mm3509