[Rd] get() promise to missing arg

Andreas Kersting r-deve| @end|ng |rom @ker@t|ng@de
Tue Aug 9 17:40:22 CEST 2022


Hi,

Please consider the following:

> e <- new.env()
> delayedAssign("p", quote(expr = ), assign.env = e)
> e$m <- quote(expr = )
> identical(e$m, e$p)
[1] TRUE
> 
> get("p", e)

> get("m", e)
Error in get("m", e) : argument "m" is missing, with no default

Although objects m and p are identical(), get() behaves differently for them (in R version 4.2.1). Is this intended?

I stumbled across this in the context of utils:::print.ls_str(), which fails when encountering a promise to the missing arg:

> ls.str(e)
m : <missing>
p : Error in inherits(o, "error") : argument "o" is missing, with no default

Best,
Andreas


More information about the R-devel mailing list