The fn that does the display is the one having side effects. Now if your look fn creates the side effect, it should reflect that in its name.
But... I wonder why it does so. Looking at something does not change state. You may be better splitting the side effect away from it or change the name. Looks (no pun intended) odd from a naming perspective but w/o looking at your code base it's hard to telll. It may made sense in your context. If look is a predicate, the name might not be appropriate. number? is clearly a predicate. "look" does "look" as a true/false property to me. visible? or hidden? look to me as a predicates. But again it may make sense in your context. If your fn does too many things, you may want to split it. Luc P. > When a function returns a true/false value you should end it with a '?'. > > Clojure Programming says that with side effects you should end the function > name with a '!'. > > I have functions reset-game! and walk!. But what about a function like > look? It does not change state, but it displays where you are. So it has a > side effect. But most of my functions have this. So, should I append them > all with a '!'? > > -- > 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. > -- Softaddicts<lprefonta...@softaddicts.ca> sent by ibisMail from my ipad! -- 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.