Skip to content

Commit 8520271

Browse files
committed
More information about changed scala CLI syntax.
Signed-off-by: Dean Wampler <[email protected]>
1 parent ebbb43b commit 8520271

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,22 @@ The `master` branch and the `3.X.Y` tag releases are for the third edition. The
1515

1616
> [!WARNING]
1717
> 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+
> In particular, running a scala program on the command line has changed as of 3.5.0. So, for example, on page 18 of the book, change this command for running a program at the shell prompt:
20+
>
21+
> `$ scala -cp . -M progscala3.introscala.UpperMain1 hello computed world!`
22+
>
23+
> to this:
24+
>
25+
> `$ scala -cp . -M progscala3.introscala.UpperMain1 -- hello computed world!`
26+
>
27+
> Note the required `--` to separate `scala` arguments from your programs arguments. Use this change for all subsequent examples in the book that use the `scala` command to run code.
28+
>
29+
> It appears that `sbt` syntax has **not** changed when using `runMain` at the SBT prompt:
30+
>
31+
> `> runMain progscala3.introscala.UpperMain1 hello computed world!`
32+
>
33+
> Use of `sbt` is discussed further below.
1834
1935
> [!TIP]
2036
> Several sections offer troubleshooting tips if you encounter problems.
@@ -24,7 +40,7 @@ The `master` branch and the `3.X.Y` tag releases are for the third edition. The
2440
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:
2541

2642
```scala
27-
// src/main/scala/progscala3/.../FooBar.scala
43+
// src/main/scala/progscala3.introscala.UpperMain1
2844
```
2945

3046
Following the usual conventions, tests are in `src/test/...`.

0 commit comments

Comments
 (0)