So a quick post about the latest release (0.8.0) of groovy-stream.
In a nutshell, this update has removed a couple of things, and added support for using groovy-stream from Java.
Sometimes when coding, you need to switch between letter case formats. Rather than rolling your own, or using a regular expression (shudder), you can leverage the CaseFormat enumeration in Guava.
Finally got a working implementation of a miniKanren in Groovy (I basically ported the ruby version that can be found here).
The source code can be found over here
I hit a situation where I needed to be able to change the body class for a Grails view, but found that simply setting it in the body does not work.
A new version of groovy-common-extensions is out with a new method tap.
Another blog post that’s more for me in the future so I don’t forget ;-)
Thought it might be of use to someone else as well, so posted it here for posterity.
So I recently had issues with rendering anti-aliased text over translucent backgrounds inside a Java app. Here’s a quick Groovy script that shows the problem:
As a bit of fun (after reading Alex Miller’s example of Clojure’s core-async library), I decided to implement Rock Paper Scissors using my groovy-stream library. It feels quite nice to end up with a Stream Iterator that plays a game each time you call next().
One thing I only recently learned about Groovy is that by implementing the getAt method, you can destructure your Object via multiple assignment.
As an example, consider a class Vector2D which represents a two-dimensional vector:
Last night, I saw a post on my twitter feed titled “Why Functional Programming in Java is Dangerous” where the author tries to implement the clojure code
in a functional style in Java, then concludes that “Functional idioms in Java are performance bugs waiting to bite you” after trying to load all of the Integers Java can handle into an ArrayList.
Buoyed by my success pushing the groovy-common-extensions library to maven, I pushed the groovy-stream library to maven as well, so it’s now possible (without any messing around with @GrabResolver) to give the library a whirl.