summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Williams <nico@cryptonector.com>2014-10-03 17:14:30 -0500
committerNicolas Williams <nico@cryptonector.com>2014-10-03 17:47:13 -0500
commita0a350f46808229bb25fe16ca8e82e4c2fe76d7c (patch)
treec62d4b6502b2863d7eb92eace9cfcf1aae651e92
parent4a57b84db03db7aee33c47ed6c7f6c1e648705fd (diff)
Remove sort/1 and group/1
Reserve these for sorting with jq-coded comparators.
-rw-r--r--builtin.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/builtin.c b/builtin.c
index 65b6de6a..0c0faa31 100644
--- a/builtin.c
+++ b/builtin.c
@@ -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)]);",