September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
|
|
@ -1,19 +0,0 @@
|
|||
$ scala ScriptName.scala
|
||||
Program: ScriptName.scala
|
||||
|
||||
$ scalac ScriptName.scala
|
||||
$ scala -classpath . ScriptName
|
||||
Program: ScriptName.scala
|
||||
|
||||
$ scala
|
||||
Welcome to Scala version 2.9.1.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_26).
|
||||
Type in expressions to have them evaluated.
|
||||
Type :help for more information.
|
||||
|
||||
scala> :load ScriptName.scala
|
||||
Loading ScriptName.scala...
|
||||
import scala.util.matching.Regex.MatchIterator
|
||||
defined module ScriptName
|
||||
|
||||
scala> ScriptName.main(Array[String]())
|
||||
Program: <console>
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
import scala.util.matching.Regex.MatchIterator
|
||||
|
||||
object ScriptName {
|
||||
val program = {
|
||||
val filenames = new RuntimeException("").getStackTrace.map { t => t.getFileName }
|
||||
val scala = filenames.indexOf("NativeMethodAccessorImpl.java")
|
||||
|
||||
if (scala == -1)
|
||||
"<console>"
|
||||
else
|
||||
filenames(scala - 1)
|
||||
}
|
||||
|
||||
def main(args: Array[String]) {
|
||||
val prog = program
|
||||
println("Program: " + prog)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue