(IFn f)
| 410 | } |
| 411 | |
| 412 | public Object reduce(IFn f) { |
| 413 | if(i < array.length) { |
| 414 | Object acc = MapEntry.create(array[i], array[i+1]); |
| 415 | for(int j=i+2;j < array.length;j+=2){ |
| 416 | acc = f.invoke(acc, MapEntry.create(array[j], array[j+1])); |
| 417 | if(RT.isReduced(acc)) |
| 418 | return ((IDeref)acc).deref(); |
| 419 | } |
| 420 | return acc; |
| 421 | } else { |
| 422 | return f.invoke(); |
| 423 | } |
| 424 | } |
| 425 | |
| 426 | public Object reduce(IFn f, Object init) { |
| 427 | Object acc = init; |