The language basics

Five lessons cover what every later lesson assumes: a variable with def and a variable with a type, the five kinds of string and the interpolation of a GString, why 0.1 + 0.2 is exact here, the operators that have no Java spelling, and the small rules (truthiness, imports, comments) that make a script read the way it does.

2.1 def and static types dynamic variables, declared types, and when each one is the right choice Open 2.2 Strings and GStrings single, double, triple and slashy strings, interpolation, and the GString trap Open 2.3 Numbers and BigDecimal why 0.1 + 0.2 is exact here, integer division, and the suffixes of a literal Open 2.4 Operators safe navigation, Elvis, spread, ranges, the spaceship and the rest of the shorthand Open 2.5 Truthiness, imports and comments what counts as false, the imports Groovy adds, and the comments a script takes Open

Lessons