But I think you have mixed two different issues: code style vs readability.
For code style I'll suggest the github page https://github.com/bbatsov/clojure-style-guide which offer a very nice compilation. Now for readability I would say that you can be entering in a very gray zone here. Lisp code is different than other type of code you have seen before, it's a different alphabet to do some analogy with reading. If you are not familiar with lisp (clojure) the first time you see a code is very similar to reading Chinese but because of this I wouldn't say is not readable, is just that we are not ready to even try to read from a different alphabet, you can see a text in spanish, english, french and you will recognize a lot of the characters, but not with Chinese you can't even tell if is Japanese. Just think that the rules are not the same, the standards are not the same. I remember when I start reading clojure it really strikes me the variable names, one letter [ x ] or two [ xs ] I was very familiar with other languages, and for me, that was a clear smell. Now that I have learned a little more, I understand that those names are perfectly fine, and I've understood that there are other rules, not the same that we apply with other languages. This was my personal experience so I hope this helps Erlis On Wed, Apr 10, 2013 at 1:54 PM, Softaddicts <lprefonta...@softaddicts.ca>wrote: > This single snippet does not look too obscure to me. > I have the book but never read this part. > > From what I can see, it gets a list of neighbors from the current state in > cells, > extract pairs of location/frequency (de structuring loc and n for each pair > returned by frequencies) and returns cells that match the condition > (frequency > = 3 or immediate neighbors of frequency 2 of our current state) as a set. > This gives the new state from which to proceed. I can safely assume that > the input state is also a set. > > Roughly.... I am vaguely acquainted with the problem to solve. > Of course having access to the whole source code would help a bit :) > > If the above is totally wrong then I need to get back to a coding class... > > Luc P. > > > > > > So, page 143 of Clojure Programming has an implementation of Conway's > Life: > > > > (defn step > > "Yields the next state of the world" > > [cells] > > (set (for [[loc n] (frequencies (mapcat neighbours cells)) > > > > :when (or (= n 3) (and (= n 2) (cells loc)))] > > > > loc))) > > > > The book claims this to be "an elegant implementation'. > > > > Now it's been a long while since I wrote code to put food on the table - > > but back then if I saw C or C++ code written like this I would describe > it > > as obfuscated - the sort of thing I would expect to see in the (now > > defunct?) annual obfuscated C competition. It's concise and rather > clever, > > certainly, but hardly self-documenting: it's not very clear what it's > doing > > at all- with a couple of magic numbers thrown in for good measure. Rather > > arcane in fact. > > > > Is it just me? Is this considered to be good Clojure code and I'm just > > hopelessly out of touch and need to get with the programme? > > > > > > > > > > > > > > -- > > -- > > 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. > > > > > > > -- > 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/groups/opt_out. > > > -- -- 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.