-
Notifications
You must be signed in to change notification settings - Fork 65
Open
Labels
Description
I'm running the following code from Ruby, in RC14 ('rlang' and 'purrr') have already been loaded:
Polyglot.eval("R", <<-R)
fidx = function(idx) {
print(typeof(idx))
print(class(idx))
print(idx)
print(is_missing(idx))
}
ma = missing_arg()
f = fidx
params = list()
params = `[[<-`(params, 1, ma)
invoke(f, params)
print("======")
fidx(ma)
R
The output of this code is:
[1] "NULL"
[1] "NULL"
[polyglot value]
[1] TRUE
[1] "======"
[1] "symbol"
[1] "name"
[1] TRUE
Note that the first time 'print(idx)' is called it outputs [polyglot value], but this should not be so, since the whole code is inside a single Polyglot call.
Also if running this code in gnuR, gives:
Error in typeof(idx) : argument "idx" is missing, with no default
Even the call 'fidx(ma)' that does what I wanted, in gnuR actually does not work and give the same error as above.