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

Add #sort to List #43

Merged
merged 2 commits into from
May 13, 2019
Merged

Add #sort to List #43

merged 2 commits into from
May 13, 2019

Conversation

moba1
Copy link
Collaborator

@moba1 moba1 commented May 13, 2019

Abstract

add #sort to List.
This method returns sorted new List.

Example

List[].sort == List[]
List[1,4,2,3].sort == List[1,2,3,4]
# able to pass block
(List[1,3,2].sort { |x, y| x <=> y }) == List[1,2,3]
# sort by descending order
(List[1,3,2].sort { |x, y| y <=> x }) == List[1,2,3]

@moba1 moba1 requested a review from alex-lairan May 13, 2019 07:29
@alex-lairan alex-lairan merged commit 371ab49 into master May 13, 2019
@alex-lairan alex-lairan deleted the add/impl-#sort-to-list branch May 13, 2019 11:50
@alex-lairan alex-lairan mentioned this pull request May 21, 2019
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