-
-
Save HouLinwei/a331342af117dc3d9d150f40bf701e2f to your computer and use it in GitHub Desktop.
example of a simple scala script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| #This is an example scala script which requires the user to have scala in the PATH | |
| #you can set CP to contain whatever other jars you need | |
| CP=. | |
| exec scala -classpath $CP "$0" "$@" | |
| !# | |
| val x = 1 to 10 | |
| val sum = x.foldLeft(0)(_+_) | |
| println("sum=" + sum); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment