Skip to content

ERROR: UndefVarError: val not defined #510

Open
@schlichtanders

Description

@schlichtanders

RCall reval cannot handle empty strings, but instead throws a quite surprising error.

julia> using RCall
julia> reval("# mycomment")
ERROR: UndefVarError: `val` not defined
Stacktrace:
 [1] reval_p(expr::Ptr{RCall.ExprSxp}, env::Ptr{EnvSxp})
   @ RCall ~/.julia/packages/RCall/gOwEW/src/eval.jl:126
 [2] reval(str::String, env::RObject{EnvSxp})
   @ RCall ~/.julia/packages/RCall/gOwEW/src/eval.jl:136
 [3] reval(str::String)
   @ RCall ~/.julia/packages/RCall/gOwEW/src/eval.jl:136
 [4] top-level scope
   @ REPL[7]:1

Either the error message could be improved, or, which would be my preferred option, simple return nothing in these cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions