Closures and Bindings in Groovy

30. December, 2011

Mark Menard blogged about a hidden gem in Groovy which might be useful when you use closures a lot: Binding properties to a closure after the closure was created.

Remember, it’s simple to bind properties to a closure when those properties exist before the closure is created: Just define them. But how could you create a library of closures for user to consume?

def c = {
	println a // a isn't know here

def a = "Hello"

def binding = new Binding ()
binding.setVariable ("a", a)

c.setBinding (binding)

As you can see, the property a isn’t known at the time the closure is defined. The binding allows to “inject” it later.


New Years Resolution: Stop being so agreeable!

30. December, 2011



Building BIRT with Tycho

27. December, 2011

If you want to see BIRT built with Tycho, vote for this bug: [Build] Migrate build to Tycho

So Help me Jobs…

26. December, 2011

One day, Apple might go one step further and start to shape their customers to their liking. They know best, right? Watch this.

“I have nothing to hide.” “Then why do you have curtains?

Open Data ala Google

21. December, 2011



64K on Stackoverflow.com

12. December, 2011
Image representing Stack Overflow as depicted ...

Q&A for professional and enthusiast programmers




Making openSUSE 11.4 Work on HP ProBook 5320m

11. December, 2011


  3. Unpack the archive
  4. cd xf86-video-intel-2.15.0
  6. make
  7. as root: make install
  9. Reboot.
