On Thu, Feb 10, 2011 at 12:06 AM, Andreas Kostler
wrote:
> Hi Ken,
> Thanks again. However, I still have one nagging gap in understanding this
> macro.
> If I replace
>
> (defmacro time-limited [ms & body]
> `(let [f# (future ~@body)]
> (. get f# ~ms java.util.concurrent.TimeUnit/MILLISECONDS
Hi Ken,
Thanks again. However, I still have one nagging gap in understanding this macro.
If I replace
(defmacro time-limited [ms & body]
`(let [f# (future ~@body)]
(. get f# ~ms java.util.concurrent.TimeUnit/MILLISECONDS)))
which expands to:
(macroexpand-1 '(time-limited 1000 (println "H
On Wed, Feb 9, 2011 at 6:07 AM, Andreas Kostler
wrote:
> Hello all,
> I've come across the following macro, which basically tries to execute body
> and times out after ms milliseconds. It works fine :)
>
> (defmacro time-limited [ms & body]
> `(let [f# (future ~@body)]
> (. get f# ~ms java.u
Hello all,
I've come across the following macro, which basically tries to execute body and
times out after ms milliseconds. It works fine :)
(defmacro time-limited [ms & body]
`(let [f# (future ~@body)]
(. get f# ~ms java.util.concurrent.TimeUnit/MILLISECONDS)))
If I do a (macroexpand '(