Chapter 8. Polyglot and Polyparadigm
Functional programming is a programming paradigm, a framework for thinking a certain way about problems and the attendant tools to implement that vision. Many modern languages are polyparadigm (or multiparadigm): they support a number of different programming paradigms, such as object orientation, metaprogramming, functional, procedural, and many more.
Groovy is a multiparadigm language: it supports object orientation,
metaprogramming, and functional programming styles, which are mostly
orthogonal to one another. Metaprogramming allows you to add features to a language and
its core libraries. By combining metaprogramming with functional
programming, you can make your own code more functional or augment
third-party functional libraries to make them work better in
Groovy. In the next section, I show how to use metaprogramming via the
ExpandoMetaClass to weave a third-party functional library
(Functional Java) seemingly into the core of Groovy.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access