As already mentioned, you can use import to import data into repl.
To avoid importing the same material every time you reboot, you can place your common imports and definitions in a file, say imports.scala and preload this file in repl with -i .
✗ cat imports.scala import collection.mutable.HashSet ✗ scala -i imports.scala Loading imports.scala... import collection.mutable.HashSet Welcome to Scala version 2.9.0.1 (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> HashSet(1, 2) res0: scala.collection.mutable.HashSet[Int] = Set(2, 1)
source share