Skip to content

Commit

Permalink
Remove sort/1 and group/1
Browse files Browse the repository at this point in the history
Reserve these for sorting with jq-coded comparators.
  • Loading branch information
nicowilliams committed Oct 3, 2014
1 parent 4a57b84 commit a0a350f
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions builtin.c
Original file line number Diff line number Diff line change
Expand Up @@ -951,17 +951,12 @@ static const char* const jq_builtins[] = {
"def break: error(\"break\");",
"def map(f): [.[] | f];",
"def select(f): if f then . else empty end;",
"def sort(f): _sort_by_impl(map([f]));",
"def sort_by(f): sort(f);",
"def group(f): _group_by_impl(map([f]));",
"def group_by(f): group(f);",
"def unique: group(.) | map(.[0]);",
"def unique(f): group(f) | map(.[0]);",
"def unique_by(f): unique(f);",
"def max(f): _max_by_impl(map([f]));",
"def min(f): _min_by_impl(map([f]));",
"def max_by(f): max(f);",
"def min_by(f): min(f);",
"def sort_by(f): _sort_by_impl(map([f]));",
"def group_by(f): _group_by_impl(map([f]));",
"def unique: group_by(.) | map(.[0]);",
"def unique_by(f): group_by(f) | map(.[0]);",
"def max_by(f): _max_by_impl(map([f]));",
"def min_by(f): _min_by_impl(map([f]));",
#include "libm.h"
"def add: reduce .[] as $x (null; . + $x);",
"def del(f): delpaths([path(f)]);",
Expand Down

0 comments on commit a0a350f

Please sign in to comment.