You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some cases, it can be interesting to know if an argument is missing from the caller frame.
For instance, I'd like to propose a standard way to handle arguments through options when they are missing. Here, being able to check the missingness from inside a helper would be very handy.
I edited my post to show the proper FR demand.
However, I am not sure to understand, what do you mean by "fix in base"?
Also, what would you suggest instead of env?
If you don't think this would be a nice improvement to rlang::is_missing(), would you have a suggestion on a better way to do that than eval(parse(...))?
So I think we could expose this on the R level, and you could use that to detect missing arguments in a caller frame. We could add individual variants too, such as:
Hi,
In some cases, it can be interesting to know if an argument is missing from the caller frame.
For instance, I'd like to propose a standard way to handle arguments through options when they are missing. Here, being able to check the missingness from inside a helper would be very handy.
Here is a reprex with a clumsy workaround:
Created on 2024-05-30 with reprex v2.1.0
Note that
is_miss_bad()
would actually work fine ifa
didn't have a default value.Would you consider adding this feature to
rlang::is_missing()
?The text was updated successfully, but these errors were encountered: