You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 16, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: pkg/builtin/functions.go
+18-4Lines changed: 18 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,6 @@ package builtin
6
6
import (
7
7
"go.xrstf.de/rudi/pkg/coalescing"
8
8
"go.xrstf.de/rudi/pkg/eval/types"
9
-
"go.xrstf.de/rudi/pkg/eval/util"
10
9
"go.xrstf.de/rudi/pkg/eval/util/native"
11
10
)
12
11
@@ -96,9 +95,24 @@ var (
96
95
"reverse": reverseRudiFunction,
97
96
"contains?": containsRudiFunction,
98
97
99
-
"range": util.NewRawFunction(rangeFunction, "allows to iterate (loop) over a vector or object").MinArgs(3),
100
-
"map": util.NewRawFunction(mapFunction, "applies an expression to every element in a vector or object").MinArgs(2),
101
-
"filter": util.NewRawFunction(filterFunction, "returns a copy of a given vector/object with only those elements remaining that satisfy a condition").MinArgs(2),
98
+
"range": native.NewFunction(
99
+
rangeVectorFunction,
100
+
rangeObjectFunction,
101
+
).WithDescription("allows to iterate (loop) over a vector or object"),
102
+
103
+
"map": native.NewFunction(
104
+
mapVectorExpressionFunction,
105
+
mapObjectExpressionFunction,
106
+
mapVectorAnonymousFunction,
107
+
mapObjectAnonymousFunction,
108
+
).WithDescription("applies an expression to every element in a vector or object"),
109
+
110
+
"filter": native.NewFunction(
111
+
filterVectorExpressionFunction,
112
+
filterObjectExpressionFunction,
113
+
filterVectorAnonymousFunction,
114
+
filterObjectAnonymousFunction,
115
+
).WithDescription("returns a copy of a given vector/object with only those elements remaining that satisfy a condition"),
0 commit comments