Maybe contracts can be used to capture the continuation from within lambdas.
j
Jonathan
10/10/2018, 2:40 PM
@Dico. No lambda is not executed in place. The problem is that we don't know on which context the lambda of
Sequence.map
will be executed (or if it will be executed at all). This is inherent to sequences since everything will be evaluated lazily on the context of iterator's usage.
d
Dico
10/10/2018, 2:57 PM
Right, the static extension functions of
Sequence
can't make any guarantees about where/when the programmer invokes a terminal operation.