From r-deve| @end|ng |rom @ker@t|ng@de  Tue Aug  9 17:40:22 2022
From: r-deve| @end|ng |rom @ker@t|ng@de (Andreas Kersting)
Date: Tue, 09 Aug 2022 17:40:22 +0200 (CEST)
Subject: [Rd] get() promise to missing arg
Message-ID: <E1oLRLC-0004nt-Tw@rmmprod07.runbox>

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


[Rd] get() promise to missing arg
Andreas Kersting