Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: attempt to apply non-function #505

Closed
schlichtanders opened this issue Oct 29, 2023 · 5 comments
Closed

Error: attempt to apply non-function #505

schlichtanders opened this issue Oct 29, 2023 · 5 comments

Comments

@schlichtanders
Copy link

schlichtanders commented Oct 29, 2023

For some julia values, the call method is not supported on R side

PlutoUI = julia_eval("using PlutoUI; PlutoUI")
PlutoUI$Slider(c(1,2,3))

returns

REvalError: Error: attempt to apply non-function

    var"#handle_eval_stderr#31"(::Bool, ::typeof(RCall.handle_eval_stderr))@io.jl:174
    handle_eval_stderr@io.jl:168[inlined]
    reval_p(::Ptr{LangSxp}, ::Ptr{EnvSxp})@eval.jl:103
    reval_p(::Ptr{RCall.ExprSxp}, ::Ptr{EnvSxp})@eval.jl:119
    reval(::String, ::RObject{EnvSxp})@eval.jl:136
    reval(::String)@eval.jl:136
    macro expansion@[Local: 299](...)[inlined]
    top-level scope@[Local: 1](...)[inlined]

It would be great if the R call syntax works also here to run the julia call.

Workaround

julia_call("PlutoUI.Slider", c(1,2,3))
@schlichtanders
Copy link
Author

Another example:

HTML <- julia_eval("HTML")
HTML("<h1> title </h1>")

gives an error

could not find function "HTML"

despite it is callable on julia side

@schlichtanders
Copy link
Author

schlichtanders commented Nov 13, 2023

@simonbyrne can you comment here?

@palday
Copy link
Collaborator

palday commented Nov 14, 2023

This feels like a JuliaCall issue and not an RCall issue even if the error didn't happen until it hit RCall -- I suspect something in JuliaCall's wrapping and passing isn't complete.

@schlichtanders
Copy link
Author

I opened an issue at JuliaCall Non-Contradiction/JuliaCall#215

@palday
Copy link
Collaborator

palday commented Jul 17, 2024

Closing this for now, but if it turns out that there is actually something we can do on the RCall side to make things easier for JuliaCall, then I'm happy to revisit.

@palday palday closed this as completed Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants