Hi
Came across Chouser's posting below:
I know *agent* is for global designation.

My question is how the first agent (agent nil) and *agent* used
later in another nested send-off related?
Also m after (fn is a function name so that it can be referred to
later inside the same function?

Thanks
sun


user=> (def z (atom 0))
#'user/z
user=> (send-off (agent nil) (fn m [_] (Thread/sleep 500) (swap! z
inc) (send-off *agent* m)))
#<Agent clojure.lang.ag...@6fa9fc>
user=> @z
3
user=> @z
8
user=> (swap! z + 1000)
1031
user=> @z
1035
--~--~---------~--~----~------------~-------~--~----~
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