On Friday, 17 November 2017 16:53:57 UTC, Didier wrote:
>
> Why do you return an agent from a function? Can't you just return the map 
> it conatains instead? And spec that?

I want to write a function spec (s/fdef) for  a function make-agent that 
takes some initialisers and returns a new agent with its state set up. So I 
need the agent to come out of the function, not just its state.
Having said which, I could have a function make-agent-state and spec that, 
then the body of make-agent is just (agent (make-agent-state 
...initialisers...)) Is that what you're suggesting?

tbc++ - good point, I was only looking for something in the spec namespace.

Thanks all.


-- 
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