Repository navigation
Remove r_syms.unbound - #1889
Merged
Merged
Conversation
I am unsure if `r_null` is a valid return value from this helper, so I didn't want to use that. Instead we now set a `bool* found` flag on the way out.
DavisVaughan
commented
Mar 30, 2026
Comment on lines
-242
to
+254
| return r_syms.unbound; | ||
| return r_null; | ||
| } | ||
| r_obj* ffi_data_pronoun_get(r_obj* pronoun, r_obj* sym, r_obj* error_call) { | ||
| if (r_typeof(pronoun) != R_TYPE_environment) { | ||
| r_abort("Internal error: Data pronoun must wrap an environment"); | ||
| } | ||
|
|
||
| r_obj* obj = mask_find(pronoun, sym); | ||
| bool found; | ||
| r_obj* obj = mask_find(pronoun, sym, &found); | ||
|
|
||
| if (obj == r_syms.unbound) { | ||
| if (!found) { |
Member
Author
There was a problem hiding this comment.
mask_find() was using r_syms.unbound as a return value here to mean "not found"
I considered using r_null as an alternative, but I feel like it may be possible for this function to return r_null as a valid value, so I went with a bool* found flag instead.
Member
There was a problem hiding this comment.
we could use something like quote(.__rlang_unbound__.) but the output flag sounds good to me too!
This was referenced Mar 30, 2026
lionel-
approved these changes
Mar 31, 2026
Comment on lines
-242
to
+254
| return r_syms.unbound; | ||
| return r_null; | ||
| } | ||
| r_obj* ffi_data_pronoun_get(r_obj* pronoun, r_obj* sym, r_obj* error_call) { | ||
| if (r_typeof(pronoun) != R_TYPE_environment) { | ||
| r_abort("Internal error: Data pronoun must wrap an environment"); | ||
| } | ||
|
|
||
| r_obj* obj = mask_find(pronoun, sym); | ||
| bool found; | ||
| r_obj* obj = mask_find(pronoun, sym, &found); | ||
|
|
||
| if (obj == r_syms.unbound) { | ||
| if (!found) { |
Member
There was a problem hiding this comment.
we could use something like quote(.__rlang_unbound__.) but the output flag sounds good to me too!
Member
|
Thanks! |
1 of 2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Looks like we are going to lose
R_UnboundValueas well, which I guess is reasonable on Luke's partDetected in DavisVaughan/r-tree-sitter#44
I've inlined
R_UnboundValuein place ofr_syms.unboundin all the fallback paths and removedr_syms.unboundaltogether since we can't use it now.I'll call out one tricky case below