Re: Question about Clojure function naming

2016-02-19 Thread Tianxiang Xiong
Yes, as I'm reading further into the book I am coming to understand more about the differences between the ref, atom, and agent types. I am beginning to see that swap! is not an alter on atoms, etc. The way the book presents the information, though, strongly suggests parallels. Consistency is a

Re: Question about Clojure function naming

2016-02-19 Thread Gary Verhaegen
I'd say only Rich Hickey can really answer these questions, but here is one possible explanation. These functions are not equivalent. Just like 'send' on an agent has fundamental differences with 'swap!', 'alter' has fundamental differences with both. There is also some similarity, of course: in a

Re: Question about Clojure function naming

2016-02-19 Thread Atamert Ölçgen
> > why Clojure chose to name functions operating on refs and atoms so > differently swap! is not an alter on atoms. And vice versa. reset! is not a ref-set on atoms. And vice versa. The analogous functions names would make remembering which is which easier. Are you having trouble remembering