Fix the implementation of par-map&

It was pretty wrong...
This commit is contained in:
Christopher Baines 2020-10-04 13:22:35 +01:00
parent d2646e7110
commit 93c9813546

View file

@ -133,9 +133,11 @@
(let loop ((lists lists))
(match lists
(((heads tails ...) ...)
(let ((tail (defer-to-thread-pool-channel (loop tails)))
(head (apply proc heads)))
(cons head (fetch-result-of-defered-thunk tail))))
(let ((tail (loop tails))
(head (defer-to-thread-pool-channel
(lambda ()
(apply proc heads)))))
(cons (fetch-result-of-defered-thunk head) tail)))
(_
'())))))