programming_in_scala_5th_edition_index

Programming in Scala 5th edition index

Index

Symbols

! (invert)

on class Boolean

!= (not equals)

method on Any 1 2

“ (string delimiter)

”“” (raw string delimiter)

@ (at sign)

in patterns

& (bitwise-and)

on integral types

& (intersect)

on Set traits 1 2

&& (logical-and)

on class Boolean

& (diff)

on Set traits

(greater than)

on numeric types

(shift right)

on integral types

(unsigned shift right)

on integral types

: (lower bound)
= (greater than or equal to)

on numeric types

< (less than)

on numeric types

« (shift left)

on integral types

← (in)

in for expressions

<: (upper bound)

⇐ (less than or equal to)

on numeric types

' (character delimiter)

() (empty parentheses)

on method definitions

shorthand for apply method invocation

() (unit value) 1 2

  • (repeated parameter)
  • (times)

on numeric types

+ (add element)

on trait immutable.Map 1 2

on trait immutable.Set 1 2 3

+ (covariant in)

variance annotation

+ (plus)

on numeric types

++ (add elements)

on Iterable traits

on Map traits 1 2

on Set traits

on trait immutable.Set

on trait Iterator

++: (prependedAll)

on Seq traits

++= (add elements to)

on trait mutable.Map 1 2

on trait mutable.Set 1 2

++= (appendAll)

on trait Buffer

++=: (prependAll)

on trait Buffer

+: (prepended)

on Seq traits

+= (add element to)

on trait mutable.Map 1 2

on trait mutable.Set 1 2

+= (add to)

on trait mutable.Set

reassignment with immutable sets and vars

+= (append)

on class ArrayBuffer

on class ListBuffer

on trait Buffer

+=: (prepend)

on class ListBuffer

on trait Buffer

- (contravariant in)

variance annotation

- (minus)

on numeric types

- (remove element)

on trait immutable.Map 1 2

on trait immutable.Set 1 2

→ (map to)

— (remove elements)

on trait immutable.Map 1 2

on trait immutable.Set 1 2

—= (remove elements from)

on trait mutable.Map 1 2

on trait mutable.Set 1 2

on trait Buffer

-= (remove element from)

on trait mutable.Map 1 2

on trait mutable.Set 1 2

on trait Buffer

/ (divided by)

on numeric types

: (colon)

in type annotations

:+ (appended)

on Seq traits

:++ (appendedAll)

on Seq traits

:: (cons) class

as pattern constructor

:: (cons) method

on class List 1 2

right associativity of 1 2

::: (concatenation)

on class List 1 2

; (semicolon)

inference

= (variable assignment)

⇒ (right arrow, or “rocket”)

in function literals

in match alternatives

a b c d e f g h i j k l m n o p q r s t u v w y z

== (equals)

in set membership

== (equals)

in Scala versus Java

method on Any 1 2

quick introduction

??? (unimplemented)

on object Predef

  1. (pound sign)

in inner class type names

% (remainder)

on numeric types

[?\*?] (asterisk)

in import statements

repeated parameter

_ (underscore)

in function literals 1 2

in identifiers

in numeric literals

in match expressions

_1, _2, etc.(tuple accessors)

_= (underscore equals)

in setter method names

a b c d e f g h i j k l m n o p q r s t u v w y z

on integral types

(bitwise complement)

on integral types

on integral types

on Set traits

on class Boolean

{} (curly braces)

in class definitions

in imports

instead of parentheses in method invocations

` (back tick)

in constants

in identifiers

A

on object Predef 1 2

a b c d e f g h i j k l m n o p q r s t u v w y z

AssertionError class

assertions 1 2

assignment

result is unit value

associativity

right versus left 1 2

automatic

boxing

conversion, see implicit conversion

imports

auxiliary constructors

B

base classes, see superclasses

BDD, see behavior-driven development

behavior-driven development

BigInt class

BigInteger class

bitwise operations, on integral types

logical (&, |, ^, )

shift («, », »>)

blank finals (Java)

not in Scala

blocks, definition of

Boolean class 1 2

a b c d e f g h i j k l m n o p q r s t u v w y z

boolean literals

bottom types 1 2

bound variables 1 2

boxing, of value types

break keyword (Java)

living without

not in match expressions

buffer

members

Buffer trait

methods

clear

clone

insert

insertAll

padToInPlace

patchInPlace

remove 1 2

trimEnd

trimStart

++=: (prependAll)

++= (appendAll)

+=: (prepend)

+= (append)

a b c d e f g h i j k l m n o p q r s t u v w y z

–= (remove elements from)

-= (remove element from)

buffered method

on trait Iterator

by-name parameters 1 2

Byte class

C

C++ language

C# language

properties

camel casing

capitalization, of identifiers

capitalize method

on class Int (via RichInt)

cardinality, of types

case classes

case classes

cases, see alternatives

casting, see also toInt, toChar, etc.

with asInstanceOf

with typed patterns (the preferred style)

catch clauses

Cathedral and the Bazaar, The (Raymond)

chained package clauses

a b c d e f g h i j k l m n o p q r s t u v w y z

Char class

character literals

escape sequences

checked exceptions

Church, Alonzo

Class class, see classOf method

class hierarchy diagram

for maps

for Scala

for sets

class parameters

initialization order compared to abstract fields

not legal on singleton objects

classes

abstract 1 2

anonymous

case 1 2

companion

generic

inner, see inner classes

nesting of

private

sealed

clear method

a b c d e f g h i j k l m n o p q r s t u v w y z

on trait mutable.Map

on trait mutable.Set 1 2

on trait Buffer

clone method

on trait mutable.Map

on trait mutable.Set

on trait Buffer

closures 1 2

versus Java's lambdas

code duplication

reducing 1 2

collect method

on Iterable traits

on trait Iterator

CollectionConverters object

collections

api

conversion between Java and Scala

parallel 1 2

views of

combinators

companion objects

companion classes

companion objects

a b c d e f g h i j k l m n o p q r s t u v w y z

and givens

and factory methods

visibility

compare method

of trait Ordered 1 2

compatibility

Scala with Java

Scala with JavaScript

compatibility, Scala with Java

compiler errors

class …needs to be abstract, since method …in class …of type …is not defined

compiler errors

overloaded method value …with alternatives …cannot be applied to …

';' expected but ',' found

…is already defined as …

…is not a legal prefix for a constructor

class …is abstract; cannot be instantiated

class type required

constructor …cannot be accessed in …

could not find implicit value for parameter asIterable

covariant type …occurs in contravariant position in type …of value … 1 2

error overriding method …in class …of type …method …needs 'override' modifier

error overriding method …in class …of type …method … cannot override final member

illegal inheritance from final class

a b c d e f g h i j k l m n o p q r s t u v w y z

inferred type arguments …do not conform to method …type parameter bounds …

method …overrides nothing 1 2

no implicit argument matching parameter type …was found

no implicit argument matching parameter type …was found 1 2

not found: value …

reassignment to val 1 2

trait …takes type parameters

type mismatch 1 2 3 4 5 6

unreachable code

value …is not a member of …

compiler warnings

match is not exhaustive 1 2

non variable type-argument …in type pattern is unchecked since it is eliminated by erasure

compiling

complete function

complexity, managing

composition 1 2

mixin, see mixin composition

concat method

on Iterable objects

on Iterable traits

on object List

conciseness

Scala versus Java

a b c d e f g h i j k l m n o p q r s t u v w y z

concurrentmap

members

ConcurrentMap trait

methods

remove

replace

ConcurrentMap trait

methods

putIfAbsent

cons (::) method

on class List 1 2 3

right associativity of

constant patterns 1 2

constants

constructor patterns 1 2

constructors

auxiliary

in Java versus Scala

invoking superclass

primary

private

contains method

on Map traits 1 2

on Seq traits

a b c d e f g h i j k l m n o p q r s t u v w y z

on Set traits 1 2

containsSlice method

on Seq traits

context bounds

context parameters

continue keyword (Java)

living without

contravariance 1 2

control abstraction 1 2

conventions, identifier capitalization

conversion

between Java and Scala collections

between mutable and immutable collections

implicit 1 2 3 4

to specific collection types 1 2 3 4

cooperative equality

copyToArray method

on class List

on Iterable traits

on trait Iterator

corresponds method

on Seq traits

count method

on class List

a b c d e f g h i j k l m n o p q r s t u v w y z

on Iterable traits

on trait Iterator

covariance

of arrays in Java

of function result type

of lists

creating and initializing

arrays

lists

maps

objects with factories 1 2

objects with new

sets

singleton objects

tuples

curly braces

in class definitions

in imports

instead of parentheses in method invocations

currying 1 2

D

data structures

fully persistent

data types

a b c d e f g h i j k l m n o p q r s t u v w y z

algebraic

enumerated

declarations, versus definitions

decrementing

with -= 1, not —, see incrementing

def keyword 1 2

default methods

in Java

default values

of fields

defensive copies

definitions, versus declarations

dequeue method

on class Queue

derivation

typeclass 1 2 3

derived classes, see subclasses

Design Patterns (Gamma, et. al.)

diff method

on Seq traits

on Set traits

Dijkstra, Edsger

distinct method

on Seq traits

a b c d e f g h i j k l m n o p q r s t u v w y z

on trait Iterator

distinctBy method

on Seq traits

divide and conquer principle

do keyword

in for expressions

do-while loops

domain models

domain-specific languages

a little language for digital circuits

in Smalltalk and Lisp

ScalaTest's matchers DSL

Double class

downloading

Scala

source code for book examples

drop method

on class List

on class List

on Iterable traits

on trait Iterator

dropRight method

on class List

on Iterable traits

a b c d e f g h i j k l m n o p q r s t u v w y z

dropWhile method

on class List

on Iterable traits

on trait Iterator

DSLs, see domain-specific languages

duplicate method

on trait Iterator

dynamic

binding 1 2

typing 1 2

E

Eckel, Bruce

EDT, see enumerated data type

Effective C++ (Meyers)

efficiency

and hash consing

of arrays 1 2

of class ListBuffer

of fold left and right

of immutable objects

of lists

of looping versus recursion

of maps

of merge versus insertion sort

a b c d e f g h i j k l m n o p q r s t u v w y z

of sets

of value types 1 2 3

Eiffel language

else clauses

embedded DSLs, see domain-specific languages

empty method

on Iterable objects

on Map objects 1 2

on Set objects 1 2

on Set traits

empty-paren methods

enclosing instances, see inner classes

end markers

endsWith method

on Seq traits

enqueue method

on class Queue

ensuring method

on object Predef

enum keyword (Java), see Enumeration class

enum type

enumerated data type

eq method

on class AnyRef 1 2

a b c d e f g h i j k l m n o p q r s t u v w y z

equality, see also equals method

!= (not equals) method

on class Any 1 2

== (equals) method

on class Any 1 2

cooperative

eq method

on class AnyRef 1 2

in Scala versus Java

multiversal

ne method

on class AnyRef 1 2

quick introduction 1 2

universal

value versus reference

equals method

on class Any

equals method, see also equality

generated for case classes 1 2

on class Any

erasure

Erlang language 1 2

errata, viewing and reporting

errors, see also compiler errors

a b c d e f g h i j k l m n o p q r s t u v w y z

handling with exceptions

preventing

escape sequences, for character literals

eta expansion 1 2

eventually method

on trait Eventually

example code, for book

downloading

license of

exception handling

exists method

on class List

on class StringOps

on class List 1 2

on Iterable traits

on trait Iterator

export aliases

export keyword

exports

extends keyword

extension keyword

extension methods 1 2

a word of caution

quick introduction

a b c d e f g h i j k l m n o p q r s t u v w y z

external DSLs, see domain-specific languages

extractors

extractor pattern

F

f string interpolator

F# language 1 2

factory objects

factory methods 1 2

false value

fields

abstract

defining

initialization in traits

initializing to default values with uninitialized

overriding

parametric 1 2 3

private 1 2

files

ensuring closed with finally

fill method

on Iterable objects

on object List

filter method

on class List 1 2

a b c d e f g h i j k l m n o p q r s t u v w y z

on Iterable traits

on trait Iterator

filterInPlace method

on trait mutable.Map

on trait mutable.Set

filterKeys method

on MapView trait

filterNot method

on Iterable traits

on trait Iterator

filters

in for expressions

final modifier

on variables (Java), see vals

finally clauses

find method

on class List

on Iterable traits

on trait Iterator

first-order methods

on class List

flatMap method

on class List

on Iterable traits

a b c d e f g h i j k l m n o p q r s t u v w y z

on trait Iterator

flatten method

on class List

on class List

Float class

floating-point literals

fold

left

right

foldLeft method

on class List

on Iterable traits

on trait Iterator

foldRight method

on class List

on Iterable traits

on trait Iterator

for expressions 1 2

using patterns in

for loops, see also for expressions

forall method

on class List 1 2

on Iterable traits

on trait Iterator

a b c d e f g h i j k l m n o p q r s t u v w y z

foreach method

on class Array

on class List 1 2

on Iterable traits

formatted method

on Any (via StringAdd)

formatting strings

Fortran language

free variables

fully qualified names

function literals

underscores in

function literals

and closures

for partial functions

placeholder syntax 1 2

syntax of

underscores in

versus function values

function values 1 2

and closures

functional programming

lazy initialization

functional programming 1 2

a b c d e f g h i j k l m n o p q r s t u v w y z

main ideas of

functional style

methods without side effects

recognizing

refactoring functional style to

functions

basic form of

first-class 1 2

higher-order

local

partial

partially applied

predicates

procedures

pure

recursive

tail recursive

“Fundamental Concepts in Programming Languages” (Strachey)

G

Gamma, Erich

generic types

generic arrays

generic types

get method

a b c d e f g h i j k l m n o p q r s t u v w y z

on Map traits

getOrElse method

on Map traits

getOrElseUpdate method

on trait mutable.Map

getter methods 1 2 3

givens

anonymous

when multiple apply

Gosling, James

groupBy method

on Iterable traits

grouped method

on Iterable traits

on trait Iterator

groupMap method

on Iterable traits

groupMapReduce method

on Iterable traits

“Growing a language” (Steele)

H

handlers, exception, see catch clauses

hash consing

hash tries 1 2

a b c d e f g h i j k l m n o p q r s t u v w y z

hashCode method

generated for case classes 1 2

on class Any

HashMap class

in class hierarchy diagram

HashSet class

creating and initializing immutable

in class hierarchy diagram

Haskell language

Haskell language 1 2

as a lazy functional language

hasNext method

on trait Iterator

head method

on class List 1 2

on Iterable traits

headOption method

on Iterable traits

Hejlsberg, Anders

hiding

names in import clauses

names in nested packages

variables in nested blocks

higher-kinded types, see http:// booksites.artima.com/ programming_in_scala_4ed

a b c d e f g h i j k l m n o p q r s t u v w y z

higher-order functions

higher-order methods

on class List

I

identifiers

alphanumeric

capitalization conventions for

literal (with back ticks)

mixed

operator

idioms, see patterns and idioms

if expressions 1 2

immutability

as functional style

selecting mutable versus immutable collections

trade-offs

immutable.ArraySeq class

in Scala

imperative style

recognizing

refactoring to functional style

implements keyword (Java), see mixin composition

implicit conversion

to rich wrappers

a b c d e f g h i j k l m n o p q r s t u v w y z

implicit conversion 1 2 3 4

imports 1 2

hiding clauses

implicit 1 2

on-demand (i.e., wildcard)

renaming clauses

selector clauses

incrementing

with += 1, not ++

indexOf method

on Seq traits

on trait Iterator

indexOfSlice method

on Seq traits

indexWhere method

on Seq traits

on trait Iterator

indices method

on class List

on Seq traits

inference

semicolon 1 2

term

type 1 2 3

a b c d e f g h i j k l m n o p q r s t u v w y z

Hindley-Milner style

the algorithm

infix keyword

infix operator notation

information hiding 1 2

with factory methods

inhabitants, of types

inheritance

extending classes

mixing in traits

versus composition

inheritance hierarchy diagram, see class hierarchy diagram

init method

on class List 1 2

on Iterable traits

initialization

lazy

of abstract vals

of arrays

of classes, see constructors

of fields to default values

of instance variables with constructor parameters, see class parameters

of lists

of maps

a b c d e f g h i j k l m n o p q r s t u v w y z

of sets 1 2

of traits

initializers

inner classes

and path-dependent types

and private members

granting access to private members of inner classes

private, to hide implementation

insert method

on trait Buffer

insertAll method

on trait Buffer

insertion sort 1 2

instance variables

instanceOf (Java), see type tests

Int class

integer literals

interfaces (Java), see traits

internal DSLs, see domain-specific languages

interoperability

Scala with Java

Scala with JavaScript

interpolated string literals

intersect method

a b c d e f g h i j k l m n o p q r s t u v w y z

on Seq traits

on Set traits

intersection types

invoking a superclass constructor

is-a relationships

isDefinedAt method

on Map traits

on Seq traits

on trait PartialFunction

isEmpty method

on class List 1 2

on Iterable traits

on Map traits

on trait Iterator

isInstanceOf method

on class Any

Iterable objects

methods

apply

concat

empty

fill

iterate

range

a b c d e f g h i j k l m n o p q r s t u v w y z

tabulate

unfold

Iterable traits

methods

addString

collect

copyToArray

count

drop

dropRight

dropWhile

exists

filter

filterNot

find

flatMap

foldLeft

foldRight

forall

foreach

groupBy

grouped

groupMap

groupMapReduce

a b c d e f g h i j k l m n o p q r s t u v w y z

head

headOption

init

isEmpty

iterator

knownSize

last

lastOption

lazyZip

map

max

min

mkString

nonEmpty

partition

partitionMap

product

reduceLeft

reduceRight

sameElements

size

sizeCompare

sizeIs

slice

a b c d e f g h i j k l m n o p q r s t u v w y z

sliding

span

splitAt

sum

tail

take

takeRight

takeWhile

to

toArray

toIndexedSeq

toIterable

toList

toMap

toSeq

toSet

view 1 2

withFilter

zip

zipAll

zipWithIndex

++ (add elements)

concat

iterate method

a b c d e f g h i j k l m n o p q r s t u v w y z

on Iterable objects

iterator method

members

on class List

on Iterable traits

Iterator trait

methods

addString

buffered

collect

copyToArray

count

distinct

drop

dropWhile

duplicate

exists

filter

filterNot

find

flatMap

foldLeft

foldRight

forall

a b c d e f g h i j k l m n o p q r s t u v w y z

grouped

hasNext

indexOf

indexWhere

isEmpty

knownSize

length

map

max

min

mkString

next

nonEmpty

padTo

partition

patch

product

reduceLeft

reduceRight

sameElements

size

slice

sliding

sum

a b c d e f g h i j k l m n o p q r s t u v w y z

take

takeWhile

to

toArray

toIndexedSeq

toIterable

toList

toMap

toSeq

toSet

withFilter

zip

zipAll

zipWithIndex

++ (add elements)

J

Java language 1 2

wildcards

Java language

collections

covariance of arrays

default methods

inner classes

interoperability with Scala 1 2

a b c d e f g h i j k l m n o p q r s t u v w y z

raw types

JavaBeans

JavaScript language

interoperability with Scala

JSON

K

Kay, Alan 1 2

keys method

on Map traits 1 2

keySet method

on Map traits 1 2

keysIterator method

on Map traits

keywords, using as identifiers

knownSize method

on Iterable traits

on trait Iterator

L

lambda calculus

Landin, Peter

last method

on class List 1 2

on Iterable traits

lastIndexOf method

a b c d e f g h i j k l m n o p q r s t u v w y z

on Seq traits

lastIndexOfSlice method

on Seq traits

lastOption method

on Iterable traits

lattice

laws

lazy modifier

lazy functional languages

LazyList class

in Scala 1 2

lazyZip method

on class List

lazyZip method

on Iterable traits

least upper bound

length method

on class List 1 2

on trait Iterator

lengthCompare method

on Seq traits

linearization, of traits

linked lists

Liskov Substitution Principle

a b c d e f g h i j k l m n o p q r s t u v w y z

Liskov substitution principle

Lisp language 1 2

List class, see also lists 1 2

first-order methods on

higher-order methods on

immutability

methods

::: (concatenation) 1 2

addString

apply

copyToArray

count 1 2 3

drop 1 2

dropRight

dropWhile

exists 1 2

filter 1 2

find

flatMap

flatten 1 2

foldLeft

foldRight

forall 1 2

foreach 1 2

a b c d e f g h i j k l m n o p q r s t u v w y z

head 1 2

indices

init 1 2

isEmpty 1 2

iterator

last 1 2

lazyZip

length

map 1 2

mkString 1 2

partition

remove

reverse 1 2

sort

sortWith

span

splitAt

tail 1 2

take

takeWhile

toArray

toString

unzip

zip

a b c d e f g h i j k l m n o p q r s t u v w y z

zipWithIndex

:: (cons) 1 2

List object

methods

apply 1 2

concat

fill

range 1 2

tabulate

ListBuffer class 1 2

lists, see also List class 1 2

appending to

concatenation (:::)

converting to arrays

converting to strings

creating and initializing

in-depth treatment

passing elements as arguments with [?\*?]

table of methods

literals

array

boolean

character

class, see classOf method

a b c d e f g h i j k l m n o p q r s t u v w y z

floating point

identifier

integer

interpolated string

list

string 1 2

little languages, see domain-specific languages

loan pattern 1 2

local functions

local variables

logical operations (&&, ||, !)

on class Boolean

Long class

lower bounds

LSP, see Liskov Substitution Principle

LUB, see least upper bound

M

magic numbers

main method

of Scala applications

map

members 1 2

map method

on class List 1 2

a b c d e f g h i j k l m n o p q r s t u v w y z

on Iterable traits

on trait Iterator

Map objects 1 2

Map traits, see maps

methods

+ (add element)

++ (add elements)

- (remove element)

— (remove elements)

apply

clear

clone

contains

filterInPlace

get

getOrElse

getOrElseUpdate

isDefinedAt

keys

keySet

keysIterator

put

remove

update

a b c d e f g h i j k l m n o p q r s t u v w y z

updated

updatedWith

updateWith

values

valuesIterator

++= (add elements to)

+= (add element to)

—= (remove elements from)

-= (remove element from)

mapInPlace method

on mutable.IndexedSeq traits

maps 1 2 3

class hierarchy diagram

creating and initializing immutable

creating and initializing mutable

in library, not language

mutability modeled in hierarchy

table of methods

mapValues method

on MapView trait

MapView trait

methods

filterKeys

mapValues

a b c d e f g h i j k l m n o p q r s t u v w y z

match expressions

in-depth coverage

quick introduction

MatchError class

and “not exhaustive” warning

Matsumoto, Yukihiro

max method

on class Int (via RichInt) 1 2

on Iterable traits

on trait Iterator

member functions, see methods

member variables, see fields

members

abstract

field

initialization order of

method

no static

type

merge sort

methods, see also functions 1 2

abstract

as operators

as procedures

a b c d e f g h i j k l m n o p q r s t u v w y z

empty-paren

extension 1 2 3

first-order

overloading

overriding

parameterless

overriding with vals

parameters of

private

return from

sibling

when to invoke with empty parentheses 1 2

Meyer, Bertrand

Meyers, Scott

min method

on class Int (via RichInt) 1 2

on Iterable traits

on trait Iterator

mixed identifiers

mixin composition, see also traits

syntax for

mkString method

on class List 1 2

on Iterable traits 1 2

a b c d e f g h i j k l m n o p q r s t u v w y z

on trait Iterator

Multi-Java language

multiple return values 1 2

multiple variable definitions

multiversal equality

mutability

of collections

of object state

mutable.IndexedSeq

members

methods

mapInPlace

sortInPlace

sortInPlaceBy

sortInPlaceWith

N

named arguments

namespaces

in C#

Scala's two instead of Java's four

naming conventions

ne method

on class AnyRef 1 2

nesting

a b c d e f g h i j k l m n o p q r s t u v w y z

of classes and objects

of functions

of packages

.NET 1 2 3

new keyword

leaving off

not needed when calling factory methods

not needed with case classes

next method

on trait Iterator

Nice language

Nil object 1 2

Nilsson, Rickard

nominal subtyping

None object

nonEmpty method

on Iterable traits

on trait Iterator

nonvariance

Nothing type

as result type of throw expressions

as type parameter of List

in Scala class hierarchy diagram

Null class

a b c d e f g h i j k l m n o p q r s t u v w y z

in Scala class hierarchy diagram

null value

using Option instead for optional values

NullPointerException, preventing

O

Object class, see also AnyRef class

in Scala class hierarchy diagram

object keyword

object-oriented programming

object-oriented programming 1 2

Object-Oriented Software Construction (Meyer)

objects

companion, see companion objects

equality of, see equality

functional (immutable)

immutable

mutable

singleton, see singleton objects

standalone

OCaml language 1 2 3

on-demand import

opaque types

operator

associativity

a b c d e f g h i j k l m n o p q r s t u v w y z

example: class Rational with operator methods

identifiers

notation 1 2 3

infix

postfix

prefix

“overloading”

precedence 1 2

table of

optimization

of tail recursion

of value types

Option class

Ordered trait 1 2

Ordering trait

outer classes, see inner classes

overloading

constructors

methods

“operator”

override modifier 1 2

on parametric fields

overriding

defs with vals

a b c d e f g h i j k l m n o p q r s t u v w y z

methods and fields

P

package clauses 1 2

package-private access (Java)

packages

hiding

implicitly imported

unnamed package

packaging

padTo method

on Seq traits

on trait Iterator

padToInPlace method

on trait Buffer

pair, name for Tuple2

parallel collections 1 2

parameter untupling

parameterization

with types

with values

parameterized types

parameterless methods

overriding with vals

parameters

a b c d e f g h i j k l m n o p q r s t u v w y z

anonymous

by-name 1 2

class, see class parameters

context 1 2

default values

formal

named

repeated 1 2 3

type

versus arguments

parametric fields

parametric fields 1 2 3

parentheses

using curly braces instead of

when to use on method calls 1 2

partial functions

PartialFunction trait

partially applied functions

partition method

on class List

on Iterable traits

on trait Iterator

partitionMap method

on Iterable traits

a b c d e f g h i j k l m n o p q r s t u v w y z

passing arguments

to superclass a constructor

patch method

on Seq traits

on trait Iterator

patchInPlace method

on trait Buffer

path-dependent types

and inner classes

pattern matching

in exception handling

in lists

pattern guards

pattern matching

constant patterns 1 2

constructor patterns 1 2

examples of

in for expressions

in variable definitions

in-depth coverage

quick introduction

sequence patterns

tuple patterns

typed patterns

a b c d e f g h i j k l m n o p q r s t u v w y z

variable patterns 1 2

variable-binding patterns

wildcard patterns 1 2

patterns and idioms

divide and conquer principle

ensuring a resource is closed

patterns and idioms

conditional initialization

loan pattern 1 2

reading lines, characters, etc., with do-while

rich wrappers pattern

using Option not null to indicate optional values

performance

of collection types

of Scala compared to Java

Perl language

Pizza language

placeholder syntax

in function literals 1 2

PLT-Scheme language

pointers, see references

polymorphism

ad hoc 1 2

and type inference

a b c d e f g h i j k l m n o p q r s t u v w y z

postconditions, see ensuring method

postfix operator notation

precedence, operator 1 2

table of

preconditions

Predef object

methods

???

assert 1 2

ensuring

println

predicates

prefix operator notation

primary constructors

private

primitive types

private modifier

and inner classes

augmented with qualifiers, i.e., private[meeting]

granting access to private members of inner classes

on constructors

on fields 1 2

on methods

on parametric fields

a b c d e f g h i j k l m n o p q r s t u v w y z

procedures

processed string literals

product method

on Iterable traits

on trait Iterator

product types

programming style

imperative

programming style

functional

pronunciation of Scala

properties 1 2

verifiable with static typing

protected modifier

on parametric fields

public access

put method

on trait mutable.Map

putIfAbsent method

on trait ConcurrentMap

Python language 1 2

Q

Queue class

quiet syntax

a b c d e f g h i j k l m n o p q r s t u v w y z

R

range method

on Iterable objects

on object List

on object List

ranges, of basic types

raw string interpolator

raw strings

raw types (Java)

Raymond, Eric 1 2

reading

from standard input with do-while

receiver

of a method call 1 2

of an extension

recommended style, see style recommendations

recursion, see recursion

tail

optimization

using ListBuffer to prevent stack overflow

reduceLeft method

on Iterable traits

on trait Iterator

reduceRight method

a b c d e f g h i j k l m n o p q r s t u v w y z

on Iterable traits

on trait Iterator

refactoring

and static typing

and vals

imperative to functional style

reducing code duplication with closures

reference

classes

definition of

equality 1 2

referential transparency

refinement types

relational operations (>, <, >=, ⇐)

on numeric types

on trait Ordered

remove method

on class List

on trait ConcurrentMap

on trait mutable.Map

on trait mutable.Set

on trait Buffer 1 2

repeated parameters 1 2 3

REPL

a b c d e f g h i j k l m n o p q r s t u v w y z

replace method

on trait ConcurrentMap

require method

on object Predef

resources, ensuring release of 1 2

result type

covariance of

return keyword

return type

returning multiple values 1 2

reverse method

on class List 1 2

on Seq traits

reverseIterator method

on Seq traits

rich wrappers pattern

RichInt class, see Int class

Ruby language 1 2

Rumbaugh, James

running a Scala program, see scala

runtime type, definition of

S

s string interpolator

SAM types, see single abstract method types

a b c d e f g h i j k l m n o p q r s t u v w y z

sameElements method

on Iterable traits

on trait Iterator

Scala language

compiling

scala (Scala launcher)

to launch applications

to launch scripts

to launch the REPL

Scala language

class hierarchy diagram

compatibility with Java 1 2

compatibility with JavaScript

conciseness versus Java

downloading

influences on

naming of source files

pronunciation of “Scala”

REPL shell

scalability of

scripts, see scripts, Scala

specification

Scala.js

scalability

a b c d e f g h i j k l m n o p q r s t u v w y z

of Scala language

scalac (Scala compiler)

ScalaCheck 1 2

ScalaTest 1 2 3

Scheme language

scope

of variables

scripts, Scala 1 2

sealed classes

sealed modifier

search method

on Seq traits 1 2

segmentLength method

on Seq traits

selectors

in match expressions

selectors, in imports

self references

semicolon inference

seq

factory

members

passing elements as arguments with [?\*?]

Seq traits

a b c d e f g h i j k l m n o p q r s t u v w y z

methods

++: (prependedAll)

+: (prepended)

:+ (appended)

:++ (appendedAll)

apply

contains

containsSlice

corresponds

diff

distinct

distinctBy

endsWith

indexOf

indexOfSlice

indexWhere

indices

intersect

isDefinedAt

lastIndexOf

lastIndexOfSlice

lengthCompare

padTo

patch

a b c d e f g h i j k l m n o p q r s t u v w y z

reverse

reverseIterator

search 1 2

segmentLength

sortBy

sorted

sortWith

startsWith

update

updated

sequence patterns

set

members

Set objects 1 2

Set traits, see sets

methods

add

clear

clone

contains

diff

empty

filterInPlace

intersect

a b c d e f g h i j k l m n o p q r s t u v w y z

remove

subsetOf

union

update

& (diff)

& (intersect)

++= (add elements to)

+= (add element to)

—= (remove elements from)

— (remove elements)

-= (remove element from)

- (remove element)

++ (add elements)

+ (add element)

sets 1 2

and generic types

class hierarchy diagram

creating and initializing immutable

creating and initializing mutable

mutability modeled in hierarchy

table of methods

setter methods 1 2

shadowing variables

a b c d e f g h i j k l m n o p q r s t u v w y z

shell, Scala REPL

shift operations («, », »>)

on integral types

short circuiting, of logical operations

Short class

sibling methods

side effects 1 2 3

minimizing

Simula language

single abstract method types

singleton objects

initialization semantics

nesting of

singleton types

size method

on Iterable traits

on Set traits

on trait Iterator

sizeCompare method

on Iterable traits

sizeIs method

on Iterable traits

slice method

on Iterable traits

a b c d e f g h i j k l m n o p q r s t u v w y z

on trait Iterator

sliding method

on Iterable traits

on trait Iterator

Smalltalk language

SML language

snoc

Some class

sort

insertion 1 2

merge

sort method

on class List

sortBy method

on Seq traits

sorted method

on Seq traits

SortedMap trait

SortedSet trait

sortInPlace method

on mutable.IndexedSeq traits

sortInPlaceBy method

on mutable.IndexedSeq traits

sortInPlaceWith method

a b c d e f g h i j k l m n o p q r s t u v w y z

on mutable.IndexedSeq traits

sortWith method

on class List

on Seq traits

source code, downloading, see example code

source files, naming of

span method

on class List

on Iterable traits

specifier tokens

for end markers

specifiers, access, see access modifiers

specs2 1 2

split method

on class String

splitAt method

on class List

on Iterable traits

stack, the

and tail-recursive functions

and thrown exceptions

and variables captured by closures

stackable modifications

standalone objects

a b c d e f g h i j k l m n o p q r s t u v w y z

startsWith method

on Seq traits

static members

static typing

Steele, Guy

Strachey, Christopher

String class

methods

stripMargin (via StringOps)

StringBuilder class

stringly typed code

StringOps class, see also String class

strings

formatting

interpolated (processed)

iterating through the characters of

literals 1 2

long

raw

treating like a sequence (via StringOps)

structural subtyping

Structure and Interpretation of Computer Programs (Abelson, et. al.)

style recommendations

prefer classes to tuples when data combination has meaning

a b c d e f g h i j k l m n o p q r s t u v w y z

prefer vals, immutable objects, and methods without side effects

use extension methods with restraint

subclasses

defining

subsetOf method

on Set traits

subtyping

and type parameters

nominal vs. structural

versus subclassing

subtyping polymorphism

sum method

on Iterable traits

on trait Iterator

sum of products

sum types

summon method

super references

special treatment in traits

superclasses

invoking constructor on

supertype

Sussman, Gerald J.

switch statement (Java)

a b c d e f g h i j k l m n o p q r s t u v w y z

T

tabulate method

on Iterable objects

on object List

tail recursion

tail method

on class List 1 2

on Iterable traits

tail recursion

optimization

verifying with @tailrec

tailrec annotation

take method

on class List

on Iterable traits

on trait Iterator

takeRight method

on Iterable traits

takeWhile method

on class List

on Iterable traits

on trait Iterator

target typing

template, definition of

a b c d e f g h i j k l m n o p q r s t u v w y z

term inference

term, in function literals

test suites

testing 1 2

unit

Thinking in Java (Eckel)

this

throw expressions

tiny types 1 2

to method

on class Int (via RichInt) 1 2 3

on collections

on Iterable traits

on trait Iterator

on views

toArray method

on class List

on Iterable traits

on trait Iterator

toIndexedSeq method

on Iterable traits

on trait Iterator

toInt method

on class String (via StringOps)

a b c d e f g h i j k l m n o p q r s t u v w y z

toIterable method

on Iterable traits

on trait Iterator

toList method

on class ListBuffer

on class Array 1 2

on Iterable traits

on trait Iterator

toMap method

on Iterable traits

on trait Iterator

Torreborre, Eric

toSeq method

on Iterable traits

on trait Iterator

toSet method

on Iterable traits

on trait Iterator

toString method 1 2

generated for case classes 1 2

on class Any

overriding

total function, see complete function

traits, see also mixin composition

a b c d e f g h i j k l m n o p q r s t u v w y z

and abstract parameters

generic 1 2

initializing

linearization of

mixing in

transparent

transformers

transparent traits

TreeMap class

TreeSet class

TrieMap class

trimEnd method

on trait Buffer

trimStart method

on trait Buffer

true value

try expressions

tuple patterns

Tuple2 trait

tuples

creating and using

result of → operation

when to use a class instead

type constructors

a b c d e f g h i j k l m n o p q r s t u v w y z

type parameters

lower bounds

type aliases 1 2 3

type annotations 1 2 3

for debugging

type ascriptions

type casts, see casting

type erasure

type inference 1 2 3

Hindley-Milner style

the algorithm

type keyword

in type alias definitions 1 2

type members

type parameterization, see parameterized types

type parameters

upper bounds

type tests

with isInstanceOf

with typed patterns (preferred style)

type-driven design

typeclass derivation 1 2 3

typeclasses

typed patterns

a b c d e f g h i j k l m n o p q r s t u v w y z

types

abstract

bottom

cardinality of

enum

generic

ground

inhabitants

integral

intersection

numeric

opaque

path-dependent

primitive

product

refinement

result

return

runtime

single abstract method

static

sum

typing

dynamic 1 2

a b c d e f g h i j k l m n o p q r s t u v w y z

static

target

U

unary operations 1 2

unchecked annotation 1 2

unfold method

on Iterable objects

Unicode

Unified Modeling Language Reference Manual, The (Rumbaugh, et. al.)

uniform access principle

uninitialized

used to initialize a field to its default value

union method

on Set traits

Unit class

unit testing 1 2 3

unit value 1 2 3

universal apply methods

universal equality

unnamed package

until method

on class Int (via RichInt) 1 2 3

untupling

parameter

a b c d e f g h i j k l m n o p q r s t u v w y z

unzip method

on class List

update method

on class Array

on Seq traits

on trait mutable.Map

on trait mutable.Set

updated method

on Seq traits

on trait immutable.Map

updatedWith method

on trait immutable.Map

updateWith method

on trait mutable.Map

upper bounds

least

V

vals, see also variables

abstract

as fields

conditional initialization of

defining

lazy

preferring over vars

a b c d e f g h i j k l m n o p q r s t u v w y z

referencing mutable objects

“val” on class parameters

value classes

value parameterization

values method

on Map traits 1 2

valuesIterator method

on Map traits

van Rossum, Guido

variable patterns 1 2

variable-binding patterns

variable-length arguments, or “varargs”, see repeated parameters

variables

bound 1 2

captured by closures

defining

using patterns 1 2

fields

final (Java), see vals

free

instance

local

multiple definitions of

reassignable, see also vars

a b c d e f g h i j k l m n o p q r s t u v w y z

scope

shadowing

variance

annotations

compiler checking of

declaration-site

use-site

vars, see also variables

abstract

and mutable objects

as fields

defining

on class parameters

programming without

Vector class 1 2 3

VectorMap class

verifiable properties

view method

on Iterable traits 1 2

views

visibility

of givens

W

Wall, Larry

a b c d e f g h i j k l m n o p q r s t u v w y z

warnings, see compiler warnings

weak hash maps

while loops 1 2

as imperative style

wildcard given import

wildcard patterns 1 2

with keyword 1 2

withFilter method

on Iterable traits

on trait Iterator

Y

yada, yada, yada

yield keyword

in for expressions

Z

zip method

on class List

on Iterable traits

on trait Iterator

zipAll method

on Iterable traits

on trait Iterator

zipWithIndex method

on class List

programming_in_scala_5th_edition_index.txt · Last modified: 2024/04/28 03:23 (external edit)