Thanks James, it works now :)
On Thu, Jun 18, 2015 at 3:04 PM, James Reeves wrote:
> pmap is still semi-lazy, and there's little point to derefing futures in
> parallel.
>
> You'd be better off with:
>
> (doseq [r results]
> (deref r))
>
> Or:
>
> (dorun (map deref results))
>
> -
pmap is still semi-lazy, and there's little point to derefing futures in
parallel.
You'd be better off with:
(doseq [r results]
(deref r))
Or:
(dorun (map deref results))
- James
On 18 June 2015 at 12:57, Haim Ashkenazi wrote:
> Thanks Luc,
>
> This was a simplification if wha
Thanks Luc,
This was a simplification if what I really have :) I actually need the
result. The actual code was something like:
(let [results (for [host hosts]
(future (remote-exec commands host)))]
(pmap deref results))
where remote-exec runs commands via ssh-clj.
Is there
Btwy,
For is not a loop as in imperative languages. It returns a lazy sequence.
Luc P.
Sent from my iPhone
> On Jun 18, 2015, at 07:51, Haim Ashkenazi wrote:
>
> Hi,
>
> I'm trying boot scripting capabilities so I have the following file:
>
> #!/usr/bin/env boot
> (set-env!
> :dependencie
For is lazy. Replace it with doseq.
Use doseq when you want side effects to occur and do not need
a result.
Luc P.
Sent from my iPhone
> On Jun 18, 2015, at 07:51, Haim Ashkenazi wrote:
>
> Hi,
>
> I'm trying boot scripting capabilities so I have the following file:
>
> #!/usr/bin/env boot
Hi,
I'm trying boot scripting capabilities so I have the following file:
#!/usr/bin/env boot
(set-env!
:dependencies '[[org.clojure/clojure "1.6.0"]])
(defn -main
[]
(println "before")
(for [s ["one" "two" "three"]]
(do
(spit "output" s :append true)
(println s)))
(print