1
function count end
2

3
macro count(source, f)
4 23
    q = Expr(:quote, f)
5 23
    :(count($(esc(source)), $(esc(f)), $(esc(q))))
6
end
7

8
macro count(source)
9 23
    :(count($(esc(source))))
10
end
11

12
function default_if_empty end
13

14
macro default_if_empty(source)
15
	:(default_if_empty($(esc(source))))
16
end
17

18
macro default_if_empty(source, default_value)
19 23
	:(default_if_empty($(esc(source)), $(esc(default_value))))
20
end
21

22
function filter end
23

24
macro filter(source, f)
25 23
    q = Expr(:quote, f)
26 23
    :(QueryOperators.filter($(esc(source)), $(esc(f)), $(esc(q))))
27
end
28

29
function gather end
30

31
macro gather(source, withIndex = False)
32
	:(groupby($(esc(source)), $(esc(withIndex))))
33
end
34

35
function groupby end
36

37
macro groupby(source,elementSelector,resultSelector)
38 23
	q_elementSelector = Expr(:quote, elementSelector)
39 23
	q_resultSelector = Expr(:quote, resultSelector)
40

41 23
	:(groupby($(esc(source)), $(esc(elementSelector)), $(esc(q_elementSelector)), $(esc(resultSelector)), $(esc(q_resultSelector))))
42
end
43

44
macro groupby_simple(source,elementSelector)
45
	q_elementSelector = Expr(:quote, elementSelector)
46

47
	:(groupby($(esc(source)), $(esc(elementSelector)), $(esc(q_elementSelector))))
48
end
49

50
function groupjoin end
51

52
macro groupjoin(outer, inner, outerKeySelector, innerKeySelector, resultSelector)
53 23
	q_outerKeySelector = Expr(:quote, outerKeySelector)
54 23
	q_innerKeySelector = Expr(:quote, innerKeySelector)
55 23
	q_resultSelector = Expr(:quote, resultSelector)
56

57 23
	:(groupjoin($(esc(outer)), $(esc(inner)), $(esc(outerKeySelector)), $(esc(q_outerKeySelector)), $(esc(innerKeySelector)),$(esc(q_innerKeySelector)), $(esc(resultSelector)),$(esc(q_resultSelector))))
58
end
59

60
function join end
61

62
macro join(outer, inner, outerKeySelector, innerKeySelector, resultSelector)
63 23
	q_outerKeySelector = Expr(:quote, outerKeySelector)
64 23
	q_innerKeySelector = Expr(:quote, innerKeySelector)
65 23
	q_resultSelector = Expr(:quote, resultSelector)
66

67 23
	:(join($(esc(outer)), $(esc(inner)), $(esc(outerKeySelector)), $(esc(q_outerKeySelector)), $(esc(innerKeySelector)),$(esc(q_innerKeySelector)), $(esc(resultSelector)),$(esc(q_resultSelector))))
68
end
69

70
function map end
71

72
macro map(source, f)
73 23
    q = Expr(:quote, f)
74 23
    :(map($(esc(source)), $(esc(f)), $(esc(q))))
75
end
76

77
function mapmany end
78

79
macro mapmany(source,collectionSelector,resultSelector)
80 23
	q_collectionSelector = Expr(:quote, collectionSelector)
81 23
	q_resultSelector = Expr(:quote, resultSelector)
82

83 23
	:(mapmany($(esc(source)), $(esc(collectionSelector)), $(esc(q_collectionSelector)), $(esc(resultSelector)), $(esc(q_resultSelector))))
84
end
85

86
function orderby end
87

88
macro orderby(source, f)
89 23
	q = Expr(:quote, f)
90 23
    :(orderby($(esc(source)), $(esc(f)), $(esc(q))))
91
end
92

93
function orderby_descending end
94

95
macro orderby_descending(source, f)
96 23
	q = Expr(:quote, f)
97 23
    :(orderby_descending($(esc(source)), $(esc(f)), $(esc(q))))
98
end
99

100
function thenby end
101

102
macro thenby(source, f)
103
	q = Expr(:quote, f)
104
    :(thenby($(esc(source)), $(esc(f)), $(esc(q))))
105
end
106

107
function thenby_descending end
108

109
macro thenby_descending(source, f)
110
	q = Expr(:quote, f)
111
    :(thenby_descending($(esc(source)), $(esc(f)), $(esc(q))))
112
end
113

114
function take end
115

116
macro take(source, n)
117 23
	:(take($(esc(source)), $(esc(n))))
118
end
119

120
function drop end
121

122
macro drop(source, n)
123 23
	:(drop($(esc(source)), $(esc(n))))
124
end
125

126
function unique end
127

128
macro unique(source, f)
129 23
    q = Expr(:quote, f)
130 23
    :(unique($(esc(source)), $(esc(f)), $(esc(q))))
131
end

Read our documentation on viewing source code .

Loading