Implement a Set primitive to complement Dictionary and Array
**Describe the project you are working on:** An old-school match-three game, although I've encountered the need for a Hashset on other projects, and I can foresee its need on future projects. **Describe the problem or limitation you are having in your project:** Sometimes what you care about most is the relationship between data, even more so than the data itself. In my case, I care about the _set_ of data I have, and I want to easily perform traditional set operations on it, such as checking if a value exists in my collection of data, or if one set overlaps, is a subset/superset of another set, etc. My explicit example and what prompted me to open an issue, is that in finding matches for items on my game board, I need to quickly check if an item already belongs to another match that was found, determine if that type of item has already been handled by any matches, and determine if different matches overlap so that I can properly merge them. As well as numerous other little things that require the same functionality. I'm working around this by using Dictionary and only making use of the keys (just set the values to 0) when doing my checks, but what I'd ideally have access to is a Hashset. A data structure that doesn't store values, only keys, explicitly for performing fast set operations upon. **Describe the feature / enhancement and how it helps to overcome the problem or limitation:** This is related to proposal #821, but where it's concerned with adding set operations
Posted by RabbitB on May 21, 2020, 9:58 PM
Tags
Related issues
Raise real-world problems, find people facing the same issue, and discuss solutions.3,500 issues0 comments
github (EdTech)
Message limit 10000 team edition
[NEW] Data Tiering - Valkey as general data store not just in-memory data store
Info: No releases on google play for now
proposal: spec: sum types based on general interfaces
Users can't use IdPs outside of the ones enumerated by RPs
CLIP Training Code
Implement a Set primitive to complement Dictionary and Array
better documentation of reborrowing
Implement a Set primitive to complement Dictionary and Array
**Describe the project you are working on:** An old-school match-three game, although I've encountered the need for a Hashset on other projects, and I can foresee its need on future projects. **Describe the problem or limitation you are having in your project:** Sometimes what you care about most is the relationship between data, even more so than the data itself. In my case, I care about the _set_ of data I have, and I want to easily perform traditional set operations on it, such as checking if a value exists in my collection of data, or if one set overlaps, is a subset/superset of another set, etc. My explicit example and what prompted me to open an issue, is that in finding matches for items on my game board, I need to quickly check if an item already belongs to another match that was found, determine if that type of item has already been handled by any matches, and determine if different matches overlap so that I can properly merge them. As well as numerous other little things that require the same functionality. I'm working around this by using Dictionary and only making use of the keys (just set the values to 0) when doing my checks, but what I'd ideally have access to is a Hashset. A data structure that doesn't store values, only keys, explicitly for performing fast set operations upon. **Describe the feature / enhancement and how it helps to overcome the problem or limitation:** This is related to proposal #821, but where it's concerned with adding set operations
Comments (0)
No comments yet. Start the discussion.