Skip to content
Discussion options

You must be logged in to vote

I think we should only restrict the group_by() function to grouping on string types.
That is, the expression-type should evaluate to a string.

The signature becomes:

object group_by(array[object] $elements, expression->expression->string $expr)

The first and second motivating examples would become (although they would not be relevant anymore in the spec):

  • group_by(array, &to_string(a))
  • group_by(array, &to_string(b))

Replies: 3 comments 3 replies

Comment options

springcomp
Aug 5, 2022
Maintainer Author

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@springcomp
Comment options

springcomp Aug 16, 2022
Maintainer Author

Comment options

You must be logged in to vote
2 replies
@springcomp
Comment options

springcomp Aug 16, 2022
Maintainer Author

@springcomp
Comment options

springcomp Aug 16, 2022
Maintainer Author

Answer selected by springcomp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
JEP
Labels
documentation Improvements or additions to documentation, including specifying behaviour function Function proposal jep-candidate JEP (Draft) available - please vote!
1 participant