def op(acc x) if mod(x 2) +(acc x) else acc end end # add odd numbers from 0 to 1000 def main() display(fold(0 op ..(0 1000))) end