The docstring could be clearer…

 

The do-at macro (which uses the do-at* function), evaluates the expression in 
the context of the time being what you specified. Mostly useful for testing I 
suspect:

 

boot.user=> (t/do-at (-> 1 t/minutes t/from-now) (println "Hi!" (t/now)))

Hi! #object[org.joda.time.DateTime 0x169f53b5 2016-05-20T03:20:53.021Z]

nil

boot.user=> (t/now)

#object[org.joda.time.DateTime 0x11798c1b "2016-05-20T03:19:54.145Z"]

 

See how the time printed is a minute in the future of the actual time?

 

Sean Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood


 

On 5/19/16, 7:52 PM, "JvJ" <clojure@googlegroups.com on behalf of 
kfjwhee...@gmail.com> wrote:

 


Whenever I call do-at or do-at*, the result expression is executed immediately 
instead of at the specified time.

 

specs.core> (tm/do-at* (-> 30 tm/seconds tm/from-now) (fn [] (println "SUP")))

SUP

;; => nil

 

In the above example, "SUP" is printed instantaneously, even before the return 
value of do-at* is printed.

 

Is this a bug, or is there some other reason for it?

 

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to