Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use rlang_env_unbind() callable #5939

Merged
merged 3 commits into from
Sep 23, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
get rlang::rlang_env_unbind() as a callable.
  • Loading branch information
romainfrancois committed Sep 21, 2021
commit e43dc87553e1a14a4d168ce7307fcec36a7bf49b
1 change: 1 addition & 0 deletions src/dplyr.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ SEXP as_data_pronoun(SEXP x);
SEXP new_data_mask(SEXP bottom, SEXP top);
SEXP str_as_symbol(SEXP);
SEXP quo_get_expr(SEXP quo);
void env_unbind(SEXP, SEXP);
}

namespace vctrs {
Expand Down
8 changes: 7 additions & 1 deletion src/imports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ struct rlang_api_ptrs_t {
SEXP (*new_data_mask)(SEXP bottom, SEXP top);
SEXP (*str_as_symbol)(SEXP str);
SEXP (*quo_get_expr)(SEXP quo);
void (*env_unbind)(SEXP, SEXP);

rlang_api_ptrs_t() {
eval_tidy = (SEXP (*)(SEXP, SEXP, SEXP)) R_GetCCallable("rlang", "rlang_eval_tidy");
as_data_pronoun = (SEXP (*)(SEXP)) R_GetCCallable("rlang", "rlang_as_data_pronoun");
new_data_mask = (SEXP (*)(SEXP, SEXP)) R_GetCCallable("rlang", "rlang_new_data_mask_3.0.0");
str_as_symbol = (SEXP (*)(SEXP)) R_GetCCallable("rlang", "rlang_str_as_symbol");
quo_get_expr = (SEXP (*)(SEXP)) R_GetCCallable("rlang", "rlang_quo_get_expr");
quo_get_expr = (SEXP (*)(SEXP)) R_GetCCallable("rlang", "rlang_quo_get_expr");
env_unbind = (void (*)(SEXP, SEXP)) R_GetCCallable("rlang", "rlang_env_unbind");
}
};
// *INDENT-ON*
Expand Down Expand Up @@ -45,6 +47,10 @@ SEXP quo_get_expr(SEXP quo) {
return rlang_api().quo_get_expr(quo);
}

void env_unbind(SEXP env, SEXP sym) {
rlang_api().env_unbind(env, sym);
}

}

namespace vctrs {
Expand Down