Skip to content

Eliminate ATTRIB() use#87

Open
hadley wants to merge 5 commits intomainfrom
eliminate-ATTRIB
Open

Eliminate ATTRIB() use#87
hadley wants to merge 5 commits intomainfrom
eliminate-ATTRIB

Conversation

@hadley
Copy link
Member

@hadley hadley commented Feb 3, 2026

Copying the pattern from tidyverse/dplyr#7797

@hadley hadley requested a review from lionel- February 3, 2026 21:24
@@ -0,0 +1,22 @@
[
Copy link
Member Author

Choose a reason for hiding this comment

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

Am I supposed to gitignore this?

Copy link
Member

Choose a reason for hiding this comment

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

yep these commands are specific to your setup

[1] <INTSXP[10]> (altrep )
_class [2] <RAWSXP[144]> ()
_attrib [3] <LISTSXP> ()
_attrib [3] <VECSXP[3]> ()
Copy link
Member Author

Choose a reason for hiding this comment

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

Technically a regression, but I'm fine with it.

Copy link
Member

@lionel- lionel- Feb 4, 2026

Choose a reason for hiding this comment

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

hmm it'd be very confusing for such a low level inspection tool to misrepresent data structures involved.

But that was an easy fix (just collect in a pairlist), I just pushed it.

Copy link
Member

@lionel- lionel- left a comment

Choose a reason for hiding this comment

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

LG!

// CHARSXPs have fake attributes
if (TYPEOF(x) != CHARSXP )
size += obj_size_tree(ATTRIB(x), base_env, sizeof_node, sizeof_vector, seen, depth + 1);
if (TYPEOF(x) != CHARSXP && ANY_ATTRIB(x)) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Now that we have collect_attribs() should we just use it here? Probably a little bit less efficient but that's unlikely to matter?

Copy link
Member

Choose a reason for hiding this comment

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

Good idea!

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.

2 participants