You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Converted to zsh and improved handling of error cases and arg lists for the main routines. Added a description of the check-*.sh scripts to the README.
Copy file name to clipboardExpand all lines: README.md
+17-1Lines changed: 17 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,12 @@
1
1
# "Programming Scala, 3rd Edition" Code Examples
2
2
3
+
<!--
3
4
[](https://gitter.im/deanwampler/programming-scala-book-code-examples?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
* Dean Wampler's [Bluesky](https://bsky.app/profile/deanwampler.bsky.social), [Mastodon](https://discuss.systems/@deanwampler), or[LinkedIn](https://www.linkedin.com/in/deanwampler/) accounts.
9
+
* Dean Wampler's [Bluesky](https://bsky.app/profile/deanwampler.bsky.social), [Mastodon](https://discuss.systems/@deanwampler), and[LinkedIn](https://www.linkedin.com/in/deanwampler/) accounts.
8
10
*[My Book Page](http://programming-scala.org)
9
11
*[Blog about Scala 3](https://medium.com/scala-3)
10
12
@@ -173,6 +175,17 @@ $
173
175
> [!NOTE]
174
176
> The `--` argument separator is required for Scala 3.5.0 and later. It is not used for Scala 3.4.X and earlier.
175
177
178
+
### Testing the Scala Scripts and "Mains"
179
+
180
+
There are a lot of _script_ files under `src/script/scala/...`, which are used in the book as suggestions to try in the console as you are reading the book. However, they are hard to test in the usual way. Similarly, there are many `@main` routines and they are also not covered by tests. So, to "semi-automate" testing them, try the following two `zsh` scripts, both of which take a long time to run:
181
+
182
+
```shell
183
+
check-scripts.sh
184
+
check-mains.sh
185
+
```
186
+
187
+
Both have `--help` options to see what options they accept. Both do their best to check that the output is expected, but a complication is the fact that many of the Scala scripts and "mains" have deliberate errors for illustrative purposes. The `check-*.sh` scripts attempt to compensate for this, for example by knowing which scripts should fail and allowing them to fail "successfully", but to be _absolutely certain_ they are running correctly, it is really necessary to visually inspect the saved output from the runs (as described in console output of the `check-*.sh`) to see if the behavior _looks_ correct.
188
+
176
189
## Feedback
177
190
178
191
I welcome feedback on the Book and these examples. Please post comments, corrections, etc. to one of the following places:
@@ -185,6 +198,8 @@ There is also my dedicated site for the book where occasional updates, clarifica
185
198
186
199
## A Little History
187
200
201
+
Some milestones (but probably not all of them...).
202
+
188
203
| Key Dates | Description |
189
204
| :----------------- | :---------- |
190
205
| August 11, 2014 | 2nd edition examples |
@@ -202,5 +217,6 @@ There is also my dedicated site for the book where occasional updates, clarifica
202
217
| September 15, 2024 | Scala 3.5.0 changes, e.g. the [new Scala CLI](https://docs.scala-lang.org/sips/scala-cli.html). |
203
218
| December 21, 2024 | Scala 3.6.2 changes, supporting new syntax options. |
204
219
| June 17, 2025 | Scala 3.7.X breaking changes and fixed some old bugs in some of the "scripts". |
220
+
| September 20, 2025 | Scala 3.7.3 breaking changes. Yes, a "patch" release, but in fairness, triggered by my strict compiler flags. |
0 commit comments