@@ -108,6 +108,7 @@ func NewFunction0(name string, fn func() Expression) Function0 {
108108 }
109109}
110110
111+ // NewInstance implements the interface Function.
111112func (fn Function0 ) NewInstance (args []Expression ) (Expression , error ) {
112113 if len (args ) != 0 {
113114 return nil , ErrInvalidArgumentNumber .New (fn .Name , 0 , len (args ))
@@ -116,6 +117,7 @@ func (fn Function0) NewInstance(args []Expression) (Expression, error) {
116117 return fn .Fn (), nil
117118}
118119
120+ // NewInstance implements the interface Function.
119121func (fn Function1 ) NewInstance (args []Expression ) (Expression , error ) {
120122 if len (args ) != 1 {
121123 return nil , ErrInvalidArgumentNumber .New (fn .Name , 1 , len (args ))
@@ -124,6 +126,7 @@ func (fn Function1) NewInstance(args []Expression) (Expression, error) {
124126 return fn .Fn (args [0 ]), nil
125127}
126128
129+ // NewInstance implements the interface Function.
127130func (fn Function2 ) NewInstance (args []Expression ) (Expression , error ) {
128131 if len (args ) != 2 {
129132 return nil , ErrInvalidArgumentNumber .New (fn .Name , 2 , len (args ))
@@ -132,6 +135,7 @@ func (fn Function2) NewInstance(args []Expression) (Expression, error) {
132135 return fn .Fn (args [0 ], args [1 ]), nil
133136}
134137
138+ // NewInstance implements the interface Function.
135139func (fn Function3 ) NewInstance (args []Expression ) (Expression , error ) {
136140 if len (args ) != 3 {
137141 return nil , ErrInvalidArgumentNumber .New (fn .Name , 3 , len (args ))
@@ -140,6 +144,7 @@ func (fn Function3) NewInstance(args []Expression) (Expression, error) {
140144 return fn .Fn (args [0 ], args [1 ], args [2 ]), nil
141145}
142146
147+ // NewInstance implements the interface Function.
143148func (fn Function4 ) NewInstance (args []Expression ) (Expression , error ) {
144149 if len (args ) != 4 {
145150 return nil , ErrInvalidArgumentNumber .New (fn .Name , 4 , len (args ))
@@ -148,6 +153,7 @@ func (fn Function4) NewInstance(args []Expression) (Expression, error) {
148153 return fn .Fn (args [0 ], args [1 ], args [2 ], args [3 ]), nil
149154}
150155
156+ // NewInstance implements the interface Function.
151157func (fn Function5 ) NewInstance (args []Expression ) (Expression , error ) {
152158 if len (args ) != 5 {
153159 return nil , ErrInvalidArgumentNumber .New (fn .Name , 5 , len (args ))
@@ -156,6 +162,7 @@ func (fn Function5) NewInstance(args []Expression) (Expression, error) {
156162 return fn .Fn (args [0 ], args [1 ], args [2 ], args [3 ], args [4 ]), nil
157163}
158164
165+ // NewInstance implements the interface Function.
159166func (fn Function6 ) NewInstance (args []Expression ) (Expression , error ) {
160167 if len (args ) != 6 {
161168 return nil , ErrInvalidArgumentNumber .New (fn .Name , 6 , len (args ))
@@ -164,6 +171,7 @@ func (fn Function6) NewInstance(args []Expression) (Expression, error) {
164171 return fn .Fn (args [0 ], args [1 ], args [2 ], args [3 ], args [4 ], args [5 ]), nil
165172}
166173
174+ // NewInstance implements the interface Function.
167175func (fn Function7 ) NewInstance (args []Expression ) (Expression , error ) {
168176 if len (args ) != 7 {
169177 return nil , ErrInvalidArgumentNumber .New (fn .Name , 7 , len (args ))
@@ -172,6 +180,7 @@ func (fn Function7) NewInstance(args []Expression) (Expression, error) {
172180 return fn .Fn (args [0 ], args [1 ], args [2 ], args [3 ], args [4 ], args [5 ], args [6 ]), nil
173181}
174182
183+ // NewInstance implements the interface Function.
175184func (fn FunctionN ) NewInstance (args []Expression ) (Expression , error ) {
176185 return fn .Fn (args ... )
177186}
0 commit comments