Skip to content

Fix R_UnboundValue NOTE#1466

Open
Enchufa2 wants to merge 6 commits intomasterfrom
fix/1465
Open

Fix R_UnboundValue NOTE#1466
Enchufa2 wants to merge 6 commits intomasterfrom
fix/1465

Conversation

@Enchufa2
Copy link
Copy Markdown
Member

Closes #1465.

For promises, we have here a temporary workaround, but this is going to come back at us, because we are using a bunch of functions (PRVALUE, PRENV...) that are not part of the API, even if we don't see a NOTE yet. The problem is that I don't see alternatives yet.

Checklist

  • Code compiles correctly
  • R CMD check still passes all tests
  • Preferably, new tests were added which fail without the change
  • Document the changes by file in ChangeLog

Copy link
Copy Markdown
Member

@eddelbuettel eddelbuettel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. It will get in the queue of reverse depends runs to do.

if (identity == R_UnboundValue) {
stop("Failed to find 'base::identity()'");
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for kicks: when/why did we need this? When could that have been true?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

git-blame says that this is from 20 years ago, and Rcpp is 18 years old, so... never.

Copy link
Copy Markdown
Member

@eddelbuettel eddelbuettel Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it says @kevinushey did this in 2015:

454de74f5 (Kevin Ushey       2015-07-13 17:45:01 -0700 59)     if (identity == R_UnboundValue) {
454de74f5 (Kevin Ushey       2015-07-13 17:45:01 -0700 60)         stop("Failed to find 'base::identity()'");
1c90562c8 (Kevin Ushey       2015-07-13 15:43:09 -0700 61)     }

(i.e. I was asking why we added this / why we can now simply remove it).

#else
SEXP env = environment();
R_BindingType_t bt = R_GetBindingType(Storage::get__(), env);
return bt != R_BindingTypeUnbound;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, and legit per WRE's r-devel version

}
return res ;
Symbol nameSym = Rf_install(name.c_str());
return get(nameSym);
Copy link
Copy Markdown
Member

@eddelbuettel eddelbuettel Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That simplification seems almost too good to be true. Why did we not do that earlier? 😆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New NOTE nag from R-devel

2 participants