Skip to content

Conversation

@ssannkkallpp
Copy link

Addressing the following issue - #167
Added this simple implementation of the match() method based on a boolean predicate func() parameter.

@autarch
Copy link

autarch commented Nov 17, 2025

This looks good to me, but I would name this Matches, not Match. That reads a bit better when used in an if clause, IMO. I'd also note that the stdlib often uses names like MatchesFunc for funcs that take other funcs as an argument, for example the various functions in sort and slices.

@ssannkkallpp ssannkkallpp force-pushed the feature/contains-match branch from 2a78945 to fe9792e Compare November 17, 2025 21:38
@ssannkkallpp ssannkkallpp force-pushed the feature/contains-match branch from fe9792e to 79a1aa1 Compare November 17, 2025 21:47
@ssannkkallpp
Copy link
Author

This looks good to me, but I would name this Matches, not Match. That reads a bit better when used in an if clause, IMO. I'd also note that the stdlib often uses names like MatchesFunc for funcs that take other funcs as an argument, for example the various functions in sort and slices.

Agreed, changed this.

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

Successfully merging this pull request may close these issues.

2 participants