deanwampler / programming-scala-book-code-examples

The code examples used in Programming Scala, 2nd and 3rd Editions (O'Reilly)
Other
646 stars 412 forks source link

Scala Behavior Changes Make Some Examples Fail #131

Closed hellerim closed 2 months ago

hellerim commented 2 months ago

Many command line utilities which call other programs use "--" to separate arguments to these programs from the preceding arguments which are consumed by the respective utility itself. Scala and sbt obviously adopted this behavior. This is why on p. 16 ff, in particular on p.18 below, examples fail at least with Scala 3.5.0 and sbt 1.10.1, e.g. $ scala -cp . -M progscala3.introscala.UpperMain1 hello computed world! now should read $ scala -cp . -M progscala3.introscala.UpperMain1 -- hello computed world!, otherwise you should expect lots of input file not found exceptions. Since it took me quite a while to figure out the cause of these exceptions - I'm not an sbt or scala expert -, I think this new behavior should be made known in some prominent place. (?)

deanwampler commented 2 months ago

Thanks for letting me know and sorry the examples didn't work "out of the box"! I'll add some warning language about "evolving changes" to the README and fix all the examples this coming week.