Skip to content

Issue with julia_pull() #1

Description

@edwardlavender

julia_pull() does not work if you define object = ... in the function.

I.e., this works:

> julia_cmd("x = 1")
> julia_pull("x")
[1] 1

This does not work:

> julia_pull("x = 1")
Error: Error happens in Julia.
MethodError: no method matching typeof(; x::Int64)
This method does not support all of the given keyword arguments (and may not support any).
Stacktrace:
 [1] top-level scope
   @ none:1
 [2] eval(m::Module, e::Any)
   @ Core ./boot.jl:489
 [3] eval_string(x::String)
   @ Main.JuliaCall /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/library/JuliaCall/julia/setup.jl:203
 [4] docall(call1::Ptr{Nothing})
   @ Main.JuliaCall /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/library/JuliaCall/julia/setup.jl:0

This is because julia_class() gets called on x = 1 not x.

This behaviour should be documented or revised.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions