in the case of `expensiveProc().foldl(a+b)` foldl will not evaluate `expensiveProc()` `len` times. Instead, it assigns the sequence to a local variable and performs the operation on that copy but an openArray is not a firstclass type (yet?) and can't be copied.
many ways to make this work: proc sum*(values: openArray[float]):float = values.toSeq.foldl(a+b) template sum*(values: openArray[float]):float = values.foldl(a+b) template sum*(values: untyped): untyped = values.foldl(a+b) Run