Table of Contents

1. Hi There!
...in which we remove some boilerplate from a function invocation by introducing placeholder syntax.
2. UPSTAIRS downstairs
...in which we examine the ups and downs of multiple variable assignment in Scala.
3. Location, Location, Location
...in which we look at the impact of a class member's surroundings on its initialization.
4. Now You See Me, Now You Don't
...in which we follow a couple of abstract and overridden values through the class initialization order.
5. The Missing List
...in which we attempt to size up a couple of collections without worrying too much about their exact type.
6. Arg Arrgh!
...in which we try to be good functional citizens by defining generic versions of two type-specific helper functions.
7. Caught Up in Closures
...in which we catch a late glimpse at an indexed data sequence through a couple of delayed accessor functions.
8. Map Comprehension
...in which we transform some alphabet soup using a for comprehension and an application of map.
9. Init You, Init Me
...in which we define and randomly access one of a pair of mutually referential variables.
10. A Case of Equality
...in which we mix some debugging code into a case class's hashCode method.
11. If at First You Don't Succeed...
...in which we try to initialize a lazy value in changing circumstances.
12. To Map, or Not to Map
...in which we try our hand at printing Roman numerals in order of value.
13. Self: See Self
...in which we see how Scala handles self-referential variables.
14. Return to Me!
...in which we experiment with program control flow.
15. Count Me Now, Count Me Later
...in which we invoke two partially applied functions as a counter keeps on ticking.
16. One Bound, Two to Go
...in which we provide varying numbers of arguments in a partial function application.
17. Implicitly Surprising
...in which we create a partially applied function from a method with implicit parameters.
18. Information Overload
...in which we define and call overloaded methods with varying numbers of parameters.
19. What's in a Name?
...in which we call a method with and without specifying the names of the arguments.
20. Irregular Expressions
...in which we remove some debugging code from a regex match.
21. I Can Has Padding?
...in which we pad a string to a desired length, one '*' character at a time.
22. Cast Away
...in which we work with a map returned from a call to Java code by (gulp!) casting it to a Scala-typed map.
23. Adaptive Reasoning
...in which we instantiate multiple instances of a class whose constructor specifies a by-name parameter.
24. Double Trouble
...in which we sort a couple of arrays of Doubles.
25. Type Extortion
...in which we combine two lists and get a little confused when trying to extract an element from the result.
26. Accepts Any Args
...in which we refactor a method to use multiple parameter lists while forgetting to change the code that calls the method.
27. A Case of Strings
...in which we apply a pattern match to a string coming from a call to Java code.
28. Pick a Value, AnyValue!
...in which we initialize an AnyVal subtype whose specific type is declared in a subclass.
29. Implicit Kryptonite
...in which we import additional implicits to create a 'test mode' context halfway through our program.
30. Quite the Outspoken Type
...in which we define two implicit conversions, letting the compiler figure out the return type of one of them.
31. A View to a Shill
...in which we optimize a map call that only operates on the value of Map entries.
32. Set the Record Straight
...in which we convert a list into a set before adding an additional element.
33. The Devil Is in the Defaults
...in which we use two different ways to specify a default value for map entries.
34. The Main Thing
...in which we refactor an ''old skool'' object with an explicit main method by modifying it to extend the App trait.
35. A Listful of Dollars
...in which we use parentheses and curly braces to define an anonymous function.
36. Size It Up
...in which we refactor a counting method to handle general collection types.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.218.157