O'Reilly logo

Pragmatic Scala by Venkat Subramaniam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Wrapping Up

In this chapter, we explored the concepts related to function values; functions are first-class citizens in Scala. You can use code blocks to enhance the functionality of another function. You can use them to specify a predicate, a query, or a constraint to the logic being implemented in a method. You can use them to alter the control flow of a method—for example, when iterating over a collection of values. You also learned about the Execute Around Method pattern, a valuable feature that you’ll use quite frequently in Scala, both in your own code and most commonly when using the Scala library. In the next chapter, we’ll walk through another interesting Scala idiom: traits.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required