diff options
author | Felix Mulder <felix.mulder@gmail.com> | 2016-06-02 20:44:50 +0200 |
---|---|---|
committer | Felix Mulder <felix.mulder@gmail.com> | 2016-06-03 09:23:50 +0200 |
commit | 5c29e0ab8ba6220d2e4933579a6fdf9b84f8fc1e (patch) | |
tree | 4d06d4952ccf55a49d5d40c88dbef5ce89cd24b8 /src | |
parent | d4d9009a564a7c2a30a1a962da08bdab8408d717 (diff) | |
download | dotty-5c29e0ab8ba6220d2e4933579a6fdf9b84f8fc1e.tar.gz dotty-5c29e0ab8ba6220d2e4933579a6fdf9b84f8fc1e.tar.bz2 dotty-5c29e0ab8ba6220d2e4933579a6fdf9b84f8fc1e.zip |
Add documentation to REPL
Diffstat (limited to 'src')
-rw-r--r-- | src/dotty/tools/dotc/repl/REPL.scala | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/dotty/tools/dotc/repl/REPL.scala b/src/dotty/tools/dotc/repl/REPL.scala index 6fda355b5..1fcb055d6 100644 --- a/src/dotty/tools/dotc/repl/REPL.scala +++ b/src/dotty/tools/dotc/repl/REPL.scala @@ -53,19 +53,31 @@ object REPL { def context(ctx: Context): Context = ctx /** The first interpreted commands always take a couple of seconds due to - * classloading. To bridge the gap, we warm up the interpreter by letting it - * interpret at least a dummy line while waiting for the first line of input - * to be entered. + * classloading. To bridge the gap, we warm up the interpreter by letting + * it interpret at least a dummy line while waiting for the first line of + * input to be entered. */ val initialCommands: List[String] = "val theAnswerToLifeInTheUniverseAndEverything = 21 * 2" :: Nil - /** We also allow the use of setting cleanup commands in the same manner. - * This is mainly due to supporting the SBT options to specify these commands + /** Before exiting, the interpreter will also run the cleanup commands + * issued in the variable below. This is useful if your REPL creates + * things during its run that should be dealt with before shutdown. */ val cleanupCommands: List[String] = Nil - /** We also allow binding initial values */ + /** Initial values in the REPL can also be bound from runtime. Override + * this variable in the following manner to bind a variable at the start + * of the REPL session: + * + * {{{ + * override val boundValues = Array("exampleList" -> List(1, 1, 2, 3, 5)) + * }}} + * + * This is useful if you've integrated the REPL as part of your project + * and already have objects available during runtime that you'd like to + * inspect. + */ val boundValues: Array[(String, Any)] = Array.empty[(String, Any)] /** The default input reader */ |