@@ -166,7 +166,9 @@ object ArrayModule extends AbstractFunctionModule {
166166 pos : Position ): Val .Arr = {
167167 Val .Arr (
168168 pos,
169- arg.map(v => (() => _func.apply1(v, pos.noOffset)(ev, TailstrictModeDisabled )): Lazy )
169+ arg.map(v =>
170+ new LazyWithComputeFunc (() => _func.apply1(v, pos.noOffset)(ev, TailstrictModeDisabled ))
171+ )
170172 )
171173 }
172174
@@ -184,7 +186,9 @@ object ArrayModule extends AbstractFunctionModule {
184186 while (i < a.length) {
185187 val x = arr(i)
186188 val idx = Val .Num (pos, i)
187- a(i) = () => func.apply2(idx, x, pos.noOffset)(ev, TailstrictModeDisabled )
189+ a(i) = new LazyWithComputeFunc (() =>
190+ func.apply2(idx, x, pos.noOffset)(ev, TailstrictModeDisabled )
191+ )
188192 i += 1
189193 }
190194 Val .Arr (pos, a)
@@ -414,7 +418,11 @@ object ArrayModule extends AbstractFunctionModule {
414418 if (! filter_func.apply1(i, pos.noOffset)(ev, TailstrictModeDisabled ).asBoolean) {
415419 None
416420 } else {
417- Some [Lazy ](() => map_func.apply1(i, pos.noOffset)(ev, TailstrictModeDisabled ))
421+ Some [Lazy ](
422+ new LazyWithComputeFunc (() =>
423+ map_func.apply1(i, pos.noOffset)(ev, TailstrictModeDisabled )
424+ )
425+ )
418426 }
419427 }
420428 )
@@ -451,8 +459,9 @@ object ArrayModule extends AbstractFunctionModule {
451459 var i = 0
452460 while (i < sz) {
453461 val forcedI = i
454- a(i) =
455- () => func.apply1(Val .Num (pos, forcedI), pos.noOffset)(ev, TailstrictModeDisabled )
462+ a(i) = new LazyWithComputeFunc (() =>
463+ func.apply1(Val .Num (pos, forcedI), pos.noOffset)(ev, TailstrictModeDisabled )
464+ )
456465 i += 1
457466 }
458467 a
0 commit comments