Arc Forumnew | comments | leaders | submitlogin
2 points by fallintothis 5977 days ago | link | parent

I thought at at first, but that won't produce the same answers. Take his test case:

  '(1 2 3 (3 4 5) (3 4 (1 2 3)))
Using the desired method, it's:

  (/ (+ 1
        2
        3
        (/ (+ 3 4 5) 3)
        (/ (+ 3 4 (/ (+ 1 2 3) 3)) 3))
     5) ;= 13/5
But by flattening the list, we get:

  (/ (+ 1 2 3 3 4 5 3 4 1 2 3) 11) ;= 31/11


1 point by tokipin 5977 days ago | link

ah, didn't see the 'resolved' thingie

-----