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

Change tagmembers to return a list #1997

Closed
byorgey opened this issue Jun 27, 2024 · 0 comments · Fixed by #2260
Closed

Change tagmembers to return a list #1997

byorgey opened this issue Jun 27, 2024 · 0 comments · Fixed by #2260
Labels
C-Moderate Effort Should take a moderate amount of time to address. L-Commands Built-in commands (e.g. move, try, if, ...) in the Swarm language. S-Nice to have The bug fix or feature would be nice but doesn't currently have much negative impact. Z-Feature A new feature to be added to the game. Z-Refactoring This issue is about restructuring the code without changing the behaviour to improve code quality. Z-User Experience This issue seeks to make the game more enjoyable to play.

Comments

@byorgey
Copy link
Member

byorgey commented Jun 27, 2024

The tagmembers command, as implemented in #1635 , currently has type

tagmembers : Text -> Int -> Cmd (Int * Text)

i.e. it takes an entity name and an index, and returns a pair of the total number of tags for that entity plus the tag with the given index. As discussed at #1635 (review) , now that we have #1894 , we should consider changing it to simply return a list, i.e.

tagmembers : Text -> Cmd (rec l. Unit + Text * l)

This would also require updating the code for any scenarios which use the tags feature.

On the one hand, this would mean tagmembers would now require slightly more capabilities to use, but it would require less code to use and enable the use of standard list functions. It also means that it would no longer crash when called on an entity with no tags.

@byorgey byorgey added Z-User Experience This issue seeks to make the game more enjoyable to play. Z-Feature A new feature to be added to the game. Z-Refactoring This issue is about restructuring the code without changing the behaviour to improve code quality. C-Moderate Effort Should take a moderate amount of time to address. S-Nice to have The bug fix or feature would be nice but doesn't currently have much negative impact. L-Commands Built-in commands (e.g. move, try, if, ...) in the Swarm language. labels Jun 27, 2024
@kostmo kostmo closed this as completed Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Moderate Effort Should take a moderate amount of time to address. L-Commands Built-in commands (e.g. move, try, if, ...) in the Swarm language. S-Nice to have The bug fix or feature would be nice but doesn't currently have much negative impact. Z-Feature A new feature to be added to the game. Z-Refactoring This issue is about restructuring the code without changing the behaviour to improve code quality. Z-User Experience This issue seeks to make the game more enjoyable to play.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants