What is the name of startup script for the scala REPL. For example something along the lines of the following:
~/.scalarc
What is the name of startup script for the scala REPL. For example something along the lines of the following:
~/.scalarc
You could try something like:
$ alias scala='scala -i ~/.scalarc '
Note the trailing space—if you omit it your alias will disregard parameters.
Further use of 'scala' (once the alias is defined) will work as expected for REPL. If you use the alias for launching compiled programs, '~/.scalarc' will simply be ignored.
edit: It seems using '-i' in this way causes a significant slowdown.
The following, though somewhat convoluted (warning: bashism ahead), works faster:
$ scala -i <( cat ~/.scalarc foo.scala)
This concatenates your code (e.g. 'foo.scala') with '.scalarc' and evaluates everything on startup, leaving you at the REPL.
I don't think it's a satisfactory solution, but worth mentioning.