On Tuesday, April 2, 2013 1:09:25 PM UTC-6, larry google groups wrote: > > > If Clojure is suppose to emphasize immutability, why can I do this: > > kiosks-clojure.core=> (let [ > #_=> mega (+ 1 1) > #_=> mega (+ 1 mega) > #_=> mega (+ 1 mega) > #_=> mega (+ 1 mega) > #_=> mega (+ 1 mega)] > #_=> mega) > 6 > > I might as well be writing PHP code. > > Does anyone actually write Clojure code like this, or is it considered bad > form? > > It's perfectly fine. In fact, I would argue that it's bad form to invent new local names when you don't need them.
As others have said, there is nothing mutable happening here. Rebinding a local shadows the previous local of the same name, but does not change it in-place, as many other languages do. I realize that seems like a hand-wavy distinction, but it has practical consequences. See here for an example: http://chrisperkins.blogspot.com/2011/04/clojure-does-not-have-variables.html -- -- 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/groups/opt_out.