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

#listmerge: Fix post-sort with templates #24

Merged
merged 1 commit into from
Feb 7, 2025

Conversation

Derugon
Copy link
Contributor

@Derugon Derugon commented Feb 4, 2025

Motivation

The #listfilter, #listmap, #listunique, and #listmerge functions. take a list, and return a new list, doing a specific operation using a pattern or template.

Since they operate in the list from left to right, a sortmode parameter can be provided to sort the list before (sortmode = presort), after (sortmode = postsort), or both before and after (sortmode = pre/postsort) the operation is applied.

However, when given a template, the #listmerge function does not try to sort values after having applied its template, so the postsort option has no effect and pre/postsort works as presort. This is not the case when a pattern is provided instead, see the associated test case.

Proposed changes

Add a post-sorting step to #listmerge when templates are used for matching/merging values.

@alex4401 alex4401 merged commit 1f76c61 into wiki-gg-oss:master Feb 7, 2025
@Derugon Derugon deleted the listmerge-postsort branch February 8, 2025 08:04
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