Nice to see this.<p>I'm convinced, from long experience, from long experience, that functional collections are stylistically superior to imperative collections, even in otherwise imperative code.<p>In fact I'd go so far as to say that the worst mistake van Rossum made in designing Python was not to use functional collections. Then we wouldn't need to discuss how to copy them: <a href="http://news.ycombinator.com/item?id=3201033" rel="nofollow">http://news.ycombinator.com/item?id=3201033</a> There also wouldn't be this bug where using an empty list as the default value of an optional parameter would do the wrong thing (the same list object is reused on subsequent calls, when it is no longer empty).<p>(Yes, I understand, Python does have functional sets, but not AFAICT functional sequences or maps.)<p>It's great to see that Rich Hickey has designed Clojure around functional collections. I'm sure he'll do more for the cause than my own FSet library for Common Lisp, but I'll plug the latter anyway: <a href="http://common-lisp.net/project/fset/" rel="nofollow">http://common-lisp.net/project/fset/</a>
Okay, 94 points and still no comments, I'll bite.<p>I think the difference here is, and I don't think this is a subject that has been thought about quite enough, is that mathematics typically describe <i>calculation</i>, while code describes a superset of calculation, <i>computation</i>.<p>When we spend all our time working with the more expansive set, computation, we sometimes forget that calculation is in many ways less expressive and has fewer ways to express a thing. Many of the ideas in the article seem to be about getting over things we take for granted in computation, and understanding how to operate in the more limited framework offered by calculation, and/or understanding that even if things look kind of alike (what's a good word for this concept? a homoscript?) in computation vs. calculation they can be subtly different with a range of pitfalls.
"Pearls of functional algorithm design" by Richard Bird is a fabulous book along these lines. It's not exactly light reading, but the chapters are short, and some of the results are surprising, like the faster implementation of nub (unique elements in a list).<p>An aside: I was trying to brush up on Python and looked at Learn Python the Hard Way, and found exercise 25 absolutely appalling. I hope that's not idiomatic Python.