Pacific-Design.com

    
Home Index

1. Scala

2. Bash Scala

Scala / Bash Scala /

Install Scala

http://www.scala-lang.org/download/install.html

Bash - Scala


#!/bin/sh
  exec scala "$0" "$@"
  !#
  object HelloWorld {
    def main(args: Array[String]) {
      println("Hello, world! " + args.toList)
    }
  }
  HelloWorld.main(args)


./hello.sh

Scala Compiled


  object HelloWorld {
    def main(args: Array[String]) {
      println("Hello, world!")
    }
  }


$ scalac HelloWorld.scala
$ scala HelloWorld