Hi all,

Messing around with preduce at the REPL I saw this:

user=> (defn q [sofar new] (do (print new sofar"\n") (+ (+ 1 new)
sofar)))
#'user/q
user=> (reduce q 0 [1 2
3])
1 0
2 2
3 5
9
user=> (preduce q 0 [1 2
3])
3 2
6 1
8

It looks like preduce takes its arguments in the opposite order from
reduce, but of course with this fn it shouldn't make any difference:

user=> (defn q [new sofar] (do (print new sofar"\n") (+ (+ 1 new)
sofar)))
#'user/q
user=> (preduce q 0 [1 2
3])
2 3
1 6
8

Looks like it's using 3 where it should compute (q 3). This is a bug,
correct?

Thanks,
Anand
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to