Shared publicly  - 
 
New Blog Post: Examining, Comparing & Contrasting Mutable State, If/Else Blocks & For Loops in Java, Python, and Scala. http://goo.gl/OetIo
6
1
Marc-Daniel Ortega's profile photoChristopher Taylor's profile photoBrandon Hudgeons's profile photo
3 comments
 
Nice post . Enjoyed it. I read too fast J. Suereth book and forgot about the @switch.
 
thanks for the interesting post, I didn't know about @switch either. As a commenter on the blog noted, using the collections part of google's guava libs can ease a lot of the pain. Since the static methods in Iterables (http://guava-libraries.googlecode.com/svn/tags/release09/javadoc/com/google/common/collect/Iterables.html -- esp. transform and filter) produce lazy results, they even act a bit like generators in python. Obviously the syntax is nowhere near as nice, but if you create a bunch of factory methods for the Predicates and Functions, you can get pretty decent code.
Add a comment...