Skip to content

Commit d414fdb

Browse files
authored
Update README.md about evolving changes that break older code
Added a warning that the code here is evolving to track the latest changes in Scala 3.X and support tools.
1 parent 939a075 commit d414fdb

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,17 @@ This repo contains all the code examples in O'Reilly's [Programming Scala, Third
1313

1414
The `master` branch and the `3.X.Y` tag releases are for the third edition. The code examples for the second edition are still available. [Download the release tagged 2.1.0](https://github.com/deanwampler/programming-scala-book-code-examples/releases/tag/2.1.0) or check out the `release-2.1.0` branch. While the second edition was published for 2.11. The latest `2.1.0` release and `release-2.1.0` are updated for 2.12 and 2.13. (No more `release-2.X.Y` releases are planned.)
1515

16-
> **TIP:** Several sections offer troubleshooting tips if you encounter problems.
16+
> [!WARNING]
17+
> Scala 3 is evolving, as are the tools that support it. I try to keep the `main` branch up to date with the latest versions, including changing the examples as required to handle new and changed features (see, e.g., [issue #131](https://github.com/deanwampler/programming-scala-book-code-examples/issues/131)). Hence, sometimes an example (or how to run it) will be different from what you see in the book. So, if you are reading the book and want the examples exactly as they appear there, with the same tool versions used at that time, then grab the [`3.0.0-final`](https://github.com/deanwampler/programming-scala-book-code-examples/tree/3.0.0-final) release.
18+
19+
> [!TIP]
20+
> Several sections offer troubleshooting tips if you encounter problems.
1721
1822
## How the Code Is Used in the Book
1923

2024
In the book's text, when an example corresponds to a file in this distribution, the listing begins with a path in a comment with the following format:
2125

22-
```
26+
```scala
2327
// src/main/scala/progscala3/.../FooBar.scala
2428
```
2529

@@ -44,7 +48,7 @@ You won't find many comments in the code, except of the form `// <1>`, which get
4448

4549
Some files have sections marked like this:
4650

47-
```
51+
```scala
4852
// tag::section1[]
4953
// end::section1[]
5054
```
@@ -61,7 +65,7 @@ If you want to install Scala separately and Scala's *Scaladocs*, go to the [scal
6165

6266
If you want to play with the Spark example, `src/script/scala-2/progscala3/bigdata/SparkWordCount.scala`, you'll need to download a Spark distribution from https://spark.apache.org. Assuming that `$SPARK_HOME` refers to the root directory of your Spark installation, run the following command in the root directory of this project:
6367

64-
```
68+
```shell
6569
$ $SPARK_HOME/bin/spark-shell
6670
...
6771
scala>
@@ -133,7 +137,7 @@ The `~` prefix causes the task to be run continuously each time source code chan
133137

134138
Outside of `sbt`, you could, in principle, run the REPL and load the script files manually at the prompt:
135139

136-
```
140+
```shell
137141
$ scala
138142
scala> :load src/script/scala/.../Foo.scala
139143
```
@@ -142,7 +146,7 @@ However, it's easier to run most of the scripts using `sbt console`, because `sb
142146

143147
Also, new for the Scala 3 REPL, for those `src/main/...` files that define one (and only one) _entry point_, meaning a `main` method (Scala 2 compatible) or annotated with `@main` (new Scala 3 technique), you can compile and run them in one step:
144148

145-
```
149+
```shell
146150
$ scala src/main/scala/progscala3/introscala/UpperMain2.scala Hello World!
147151
HELLO WORLD!
148152
$

0 commit comments

Comments
 (0)