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.
Get Functional Thinking now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.