-
Notifications
You must be signed in to change notification settings - Fork 227
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 functions to the lists extension. #1037
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
seirl
force-pushed
the
list_functions
branch
3 times, most recently
from
October 4, 2024 17:24
f55c7c6
to
b83493c
Compare
seirl
changed the title
Upstream some list functions to cel-go
Add functions to the lists extension.
Oct 4, 2024
seirl
force-pushed
the
list_functions
branch
2 times, most recently
from
October 4, 2024 20:30
066513d
to
68bce0e
Compare
/gcbrun |
TristonianJones
requested changes
Oct 7, 2024
seirl
force-pushed
the
list_functions
branch
2 times, most recently
from
October 9, 2024 14:29
c42a523
to
80deafc
Compare
@TristonianJones Addressed all the comments, PTAL 🙂 |
seirl
force-pushed
the
list_functions
branch
3 times, most recently
from
October 9, 2024 15:23
f5b919e
to
64a9920
Compare
seirl
force-pushed
the
list_functions
branch
2 times, most recently
from
October 14, 2024 22:12
0ef68b2
to
f873984
Compare
PTAL. Also can you confirm that you're okay with the naming for the internal sortBy function ( |
/gcbrun |
Looking pretty good, and the naming of the internal sorting function is good for me. Thanks! |
/gcbrun |
Done! |
/gcbrun |
TristonianJones
approved these changes
Oct 21, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These list functions are used in an internal Google project, but are useful enough that they can be upstreamed to the Go implementation, and later to other runtimes.
The new functions are:
range()
to return a list of integers from 0 to n-1.reverse()
to return the reverse of a list.distinct()
to return the unique elements in a list.sortByAssociatedKeys()
to sort a list by a list of keys, used to implement thesortBy()
macro.The new macros are:
sortBy()
, used like:<listExpr>.sortBy(<elementBinding>, <keyExpression>)
to sort a list by a "key expression" applied to each element, similar tol.sort(key=lambda e: keyExpression)
in Python.