Groovy and Grails Puzzlers - As usual - Traps, Pitfalls, and End Cases
summary
Rapid-fire Groovy gotchas with concrete outputs and fixes: live examples on Groovy 2.3.6, behavior in the Groovy Console and Intelli, and when @CompileStatic forces compile-time failures. Demos show unary minus precedence producing -3, char '9' converting to 57 (char code) affecting max(), ranges of doubles using iterator so 1..10 does not contain 5.6, map keys keep literal types, and returns inside closures versus methods causing unexpected true/null. Two language bugs are filed during the session.
AI-written summary · about
chapters (19)
- 0:00Introduction to puzzlers
- 4:20Iteration and collection
- 8:45Operator precedence
- 15:18Max value calculation
- 18:50Primitive types in Groovy
- 23:15Delegation and imports
- 28:25Closure scoping
- 32:25Mixin and class properties
- 38:05Exception handling traps
- 44:15Public traits and fields
- 47:54Range and collection logic
- 53:12Literal types in maps
- 59:45Type casting and static
- 1:03:53Operator overloading
- 1:07:52Array versus range syntax
- 1:11:00Closures and return behavior
- 1:15:22Static method missing
- 1:19:12Identifier and property rules
- 1:23:20Final conclusions
related talks
01h 00mGroovy Puzzlers — Strange, Unclear, and "Mom, What Is That?!"
57mThe Epic Groovy Puzzlers S02: The revenge of the parentheses
40mThe Epic Groovy Puzzlers S02: The Revenge of the Parentheses
57mJava Puzzlers S03
40mJava Puzzlers, Strange Loop Edition
50mModern Java Puzzlers
56mGroovy Puzzlers S03 – Groove Like a Groovemaker!
16m8 Java quirks in 16 minutes
