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

Add optinal component grouping #30

Closed
rafaqz opened this issue Oct 15, 2023 · 3 comments
Closed

Add optinal component grouping #30

rafaqz opened this issue Oct 15, 2023 · 3 comments

Comments

@rafaqz
Copy link
Owner

rafaqz commented Oct 15, 2023

Often optional components come in loose groups, like mutating functions push!, delete!, empty! would often all be implemented for a mutable AbstractSet.

it would be good to be able to specify this group with just mutable, and get the tests and traits for all its components.

Nested NamedTuple is one simple way to do it - but it loses the posibility to have components in multiple overlapping groups. adding a groups object after optional may be better design. It would be a NamedTuple of tuples of Symbol.

@gdalle
Copy link
Collaborator

gdalle commented Oct 30, 2023

While I understand the purpose, in the spirit of simplicity I don't really like the idea of a groups named tuple key. I think the person defining the interface can handle overlapping groups themselves, by concatenating named tuples.

@gdalle
Copy link
Collaborator

gdalle commented Oct 30, 2023

OK I'm starting to see what you mean as I take a look at #27

Maybe if we had inheritance we could use that instead of groups?
As in, ArrayInterface could inherit from ArrayModifyInterface and ArrayQueryInterface?

@rafaqz
Copy link
Owner Author

rafaqz commented Oct 31, 2023

Yeah this comes from the Set interface. And yes inheritance could really solve a bunch of this. I'll actually close this in favor of #33

@rafaqz rafaqz closed this as completed Oct 31, 2023
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

No branches or pull requests

2 participants