-
Notifications
You must be signed in to change notification settings - Fork 137
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
FR: -sort-keyed #156
Comments
So basically you map, sort with remembering the order and then unmap? |
I build list of conses of keys and values, sort that, and than map to discard keys. Here it is:
|
Yea, this already exists in dash. The problem is that it doesn't work well without lexical scope (the lambda there can break quite easily). See |
No, the function I proposed is the same as What is the problem with lambdas and non-lexical binding? That you can accidentally shadow a variable user depends on? |
Consider for example
|
Well, that's a bit silly example... I'll try to come up with something better :D I'm not sure now it showcases what I wanted. |
Can you open a PR with your implementation so we can review it? |
Followed in the PR. |
I have already written the function, but then noticed in the docs that it can easily be composed from existing stuff:
Therefore I didn't finish my work and decided to ask if it is wanted first.
I still think that the function is useful:
key-comparator
exactlyN
times, while existing function calls itO (N log N)
times, which makes a significant difference ifN
is large andkey-computer
is non-trivial;If this function is wanted, I can finish what I started with documentation and tests.
The text was updated successfully, but these errors were encountered: