Skip to content

Commit c922d9e

Browse files
Update docs/blog/_posts/2020-12-18-scala3-m3.md
Co-authored-by: Sébastien Doeraene <[email protected]>
1 parent 8dde513 commit c922d9e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

docs/blog/_posts/2020-12-18-scala3-m3.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,11 @@ As part of the tooling effort, this new Scala 3 documentation tool is rapidly im
138138
println(s"Hello ${name}!")
139139
```
140140

141-
If you have Scala 3 binaries on your path (which you can get by following the steps at the [Dotty website](https://dotty.epfl.ch/)'s section "Try Dotty"), you can run the `scala Main.scala World` command. This command will compile the source in question to a temporary directory and run the discovered main method with the argument `World`.
141+
If you have Scala 3 binaries on your path (which you can get by following the steps on the [Dotty website](https://dotty.epfl.ch/), in the section "Try Dotty"), you can run the following command:
142+
143+
$ scala Main.scala World
144+
145+
This will compile the source in question to a temporary directory and run the discovered main method with the argument `World`.
142146

143147
Note the difference from the Scala 2 scripting implementation. In Scala 2, we do not require the users to have a `main` method in their scripts due to it being too cumbersome to write. In Scala 3, thanks to the top-level definitions and the `@main` annotations, `main` methods are one-liners and hence are more suited for scripts.
144148

0 commit comments

Comments
 (0)