Change tagmembers
to return a list
#1997
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.
The
tagmembers
command, as implemented in #1635 , currently has typetagmembers : 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.The text was updated successfully, but these errors were encountered: