Java developers seldom think about control structures such as for, while, or if—these are part of the Java language. Scala, by contrast, has a richer set of control structures, and many of those control structures are implemented as methods that consume functions as their parameters. The Actor API defines a handful of carefully crafted control structures designed to direct actor behavior, such as act, receive, or reply.
Scala makes creating new control structures even more natural with a little syntactic sugar: when a Scala method has only one parameter, you can surround the method argument with curly braces instead of parentheses. The following are equivalent uses of the same method: