Quantcast
Viewing latest article 2
Browse Latest Browse All 4

Answer by timday for Can a Scala script reference other uncompiled scala code in the same directory?

Maybe not exactly what you're looking for, but from the Scala REPL shell you can do

:load hello.scala:load do.scala

to achieve the same result:

$ scalaWelcome to Scala version 2.9.1 (Java HotSpot(TM) Server VM, Java 1.6.0_26).Type in expressions to have them evaluated.Type :help for more information.scala> :load hello.scalaLoading hello.scala...defined module helloscala> :load do.scalaLoading do.scala...hello worldscala> 

If you're wanting something non-interactive for scripting

$ cat <<EOF | scala:load hello.scala:load do.scalaEOF

works too.

Use :help for more interesting things the REPL shell can do.


Viewing latest article 2
Browse Latest Browse All 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>