Download Atomic Scala: Learn Programming in the Language of the by Dianne Marsh Bruce Eckel PDF

Posted by

By Dianne Marsh Bruce Eckel

Atomic Scala introduces the rules of the Scala programming language in very small steps (which we name atoms). The ebook is designed to simplify studying the language for either novices and skilled programmers. Atomic Scala by means of Bruce Eckel and Dianne Marsh is now to be had as a print ebook (the book will seem later, when we deal with all of the formatting matters, that are extra concerned due to fonts and code listings).

Show description

Read Online or Download Atomic Scala: Learn Programming in the Language of the Future PDF

Best introductory & beginning books

XML

Python An Introduction to Programming

This publication is an creation to programming suggestions that makes use of Python three because the goal language. It follows a pragmatic just-in-time presentation – fabric is given to the coed whilst it's wanted. Many examples can be in keeping with video games, simply because Python has develop into the language of selection for uncomplicated video game improvement.

Extra resources for Atomic Scala: Learn Programming in the Language of the Future

Example text

A compound expression can contain any number of other expressions, including other curly-braced expressions. Here’s a simple compound expression: scala> val c = { val a = 11; a + 42 } c: Int = 53 Notice that a is defined inside the compound expression. The result of the last expression becomes the result of the compound expression; here, the sum of 11 and 42 as reported by the REPL. But what about a? Once you leave the compound expression (move outside the curly braces), you can’t access a. It is a temporary variable, and is discarded once you exit the scope of the expression.

Below is a bin directory. profile file and locate the PATH directive. Add the bin directory to your PATH, again before the $PATH. profile (Or just close your shell and open a new one). Now you should be able to run scala -version and see a version number that agrees with what you’ve just installed. Atomic Scala • Installation (Linux) • 37 Source Code for the Book We include a way to easily test the Scala exercises in this book with a minimum of configuration and download. com into a convenient location on your computer.

Scala 3 val val val val 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 sunny = true hoursSleep = 6 exercise = false temp = 55 val happy1 = sunny && temp > 50 || exercise && hoursSleep > 7 println(happy1) // true val sameHappy1 = (sunny && temp > 50) || (exercise && hoursSleep > 7) println(sameHappy1) // true val notSame = (sunny && temp > 50 || exercise) && hoursSleep > 7 println(notSame) // false We introduce more Boolean Algebra here: The && means “and” and it requires that both the Boolean expression on the left and the one on the right are true to produce a true result.

Download PDF sample

Rated 4.78 of 5 – based on 15 votes