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_by macro method #3947
add sort_by macro method #3947
Conversation
repomaa
commented
Jan 27, 2017
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A documentation placeholder should be added at https://github.com/crystal-lang/crystal/blob/master/src/compiler/crystal/macros.cr#L543 .
I'm curious, which scenario forced you sort in macros?
3fdd401
to
c14033f
Compare
@bcardiff done :) Sorry I forgot about that. I was writing a kind of model interface similar to json mapping and was building an initializer that would take arguments from the mapping named tuple. There i needed to sort the arguments by nilable so that args that are mandatory are leftmost. There are other ways of doing it of course but i was confused that ArrayLiteral didn't have a sort_by method so i thought it would be nice to have. |
c14033f
to
ae7b8da
Compare
@jreinert Could you rebase on master? |
ae7b8da
to
63d7e5f
Compare
@straight-shoota: done! |
@RX14 @straight-shoota: ping |