Scala Design Patterns.
上QQ阅读APP看书,第一时间看更新

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "The base class is specified using extends and then all traits are added using the with keyword."

A block of code is set as follows:

class MultiplierIdentity {
def identity: Int = 1
}

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

Error:(11, 8) object Clashing inherits conflicting members:
method hello in trait A of type ()String and
method hello in trait B of type ()String
(Note: this can be resolved by declaring an override in object Clashing.)
object Clashing extends A with B {
^

Any command-line input or output is written as follows:

Result 1: 6
Result 2: 2
Result 3: 6
Result 4: 6
Result 5: 6
Result 6: 3

Bold: Indicates a new term, an important word, or words that you see onscreen.

Warnings or important notes appear like this.
Tips and tricks appear like this.