© Toby Weston 2018
Toby WestonScala for Java Developershttps://doi.org/10.1007/978-1-4842-3108-1_15

15. Faking Language Constructs

Toby Weston
(1)
London, UK
 
Scala allows you to write your code in such a way as to give the impression that you’re working with native language constructs , when really you’re just working with regular methods.
This chapter will cover the following:
  • How Scala allows you to use curly braces instead of regular parentheses when calling methods.
  • How Scala supports higher-order functions: functions that take functions as arguments and return functions as results.
  • How Scala supports currying out of the box.
These things don’t sound that impressive, but combined they allow for a surprising amount of flexibility. We’ll see how these ...

Get Scala for Java Developers: A Practical Primer 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.