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

Provide a sorted operator #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on May 21, 2015

  1. Provide a sorted operator

    This sorts (using python sorted) the current object's value if it is a
    list or dict and returns the list or keys.
    
    This is presented a strawman proposal for doing sorts as I couldn't
    decide how to do it correctly. At least with some starting code maybe
    we can reach something better.
    
    Note that the goal here is to get a sorted list of atomic entities
    which can be evalauted, not to sort a collection of objects by a key
    of those objects. That would be useful too, and presumably there is a
    way to do it generically.
    
    The demonstrated syntax is:
    
       foo.`sorted`
    
    presumably things like like:
    
       foo.[/]        # ascending sort of this
       foo.[\]        # descending sort of this
       foo.[/somekey] # ascending sort by somekey's value
    
    ought to be possible but I do not know if it is aligned with proper
    JSONPath.
    cdent committed May 21, 2015
    Configuration menu
    Copy the full SHA
    237628f View commit details
    Browse the repository at this point in the history