This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
Originally posted by Chris Patti: Aha! I finally get it! So an Expando is just a map that lets you call methods on it which are actually the map's keys, and the values are a closure that does whatever you want it to do.
Just to make sure you caught it, a map in Groovy lets you use keys as methods (syntactically) too. See the doSomething key in my example, which worked for both map and Expando.
The primary difference was for toString, hashCode, and equals - the map won't let you override them but Expando does.
subject: Still fuzzy on the Expando class - have any good examples of its use?