Mercurial > repos > tabletprog
comparison modules/array.tp @ 323:eb5f1fca9b78
Fix infinite loop in foldr:with
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 23 Mar 2015 21:18:26 -0700 |
parents | fb54a3af9c86 |
children | eef8a5cea812 |
comparison
equal
deleted
inserted
replaced
322:fb54a3af9c86 | 323:eb5f1fca9b78 |
---|---|
89 | 89 |
90 foldr:with <- :acc :fun { | 90 foldr:with <- :acc :fun { |
91 idx <- length - 1 | 91 idx <- length - 1 |
92 while: {idx >= 0} do: { | 92 while: {idx >= 0} do: { |
93 acc <- fun: acc (get: idx) | 93 acc <- fun: acc (get: idx) |
94 idx <- idx - 1 | |
94 } | 95 } |
95 acc | 96 acc |
96 } | 97 } |
97 | 98 |
98 map <- :fun { | 99 map <- :fun { |