2014-07-11 11:28 GMT+02:00 Stefan Kamphausen <ska2...@gmail.com>: > On Friday, July 11, 2014 11:10:53 AM UTC+2, Cecil Westerhof wrote: >> >> 2014-07-10 18:34 GMT+02:00 Plínio Balduino <pbal...@gmail.com>: >> >> IMO, ! is used when change any global state. A side effect like print on >>> screen is not enough to cause a ! in the name. I think that's why the >>> functions print/println don't have ! =) >>> >> >> Than I did it in the 'right' way. In the book the where talking about >> side-effects, but only a change in global >> >> state is more reasonable. >> > > IMHO, there is a slight difference between "chaning global state" and > "can not be used in STM". The STM machinery might call your function > several times. If the changes to make to some global state do not matter > if being called several times, don't use the bang. One trivial example > would be counting the collisions in STM which can be a global state change > inc'ing an atom. Logging the same action several times could also be > desired in an STM scenario. >
Well, I should change reset-game! to reset-game then. Because it always have the same effect on the global state. > All this is of course only relevant if you stick to the "official" > guideline I cited earlier. > Would not hurt to do so I think. ;-) -- Cecil Westerhof -- 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.