-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Methods for bits to union variant and back #49298
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the long-term purpose of this change? I am mildly against renamings for renamings sake, and mildly against adding internal helper functions that have no use.
The rename is for consistency with a the proposed terminology. I figured it was better to be consistent than avoid renaming an internal method, but I can change it back if it's a bad idea. It doesn't have any internal application at this time but these are some of the most basic methods necessary for working with the |
What Union-related stuff would use this? |
Wouldn't it be nice to at least offer a deprecation warning? I recommend splitting this into parts:
|
Well, there's several issues off the top of my head that are either related to traversal of I wrote it originally as part of #48728 where it's necessary to traverse If it's 100% the wrong move to include this I'm not going to fight it tooth and nail but I do think we eventually want to move a lot of C code to Julia code and to quote @KristofferC, "It's always good to get stuff from C into Julia."
Deprecation is now included. |
Alternatively, would it make sense to treat |
No, types should not be thought of as being generically indexable. Similar ideas have been proposed before and rejected, since we don't really want people to rely on that (e.g. it changes pretty often internally). |
|
I opened up the possibility of treating it like a collection because I wanted to make sure we covered our bases, but |
This is one of reasons we should have more formality in how we refer to and interact with With that in mind, it might be better for this to move away from directly using |
Implements
tag_to_variant
,variant_to_tag
, and renames/optimizesunionlen
tonvariants
. This is only intended to provide some rudimentary tools for working withUnion
and perhaps normalize some of the language used for referring toUnion
related stuff moving forward. Hopefully this will make related work a bit easier to discuss and test going forward.