@@ -53,19 +53,31 @@ object REPL {
53
53
def context (ctx : Context ): Context = ctx
54
54
55
55
/** The first interpreted commands always take a couple of seconds due to
56
- * classloading. To bridge the gap, we warm up the interpreter by letting it
57
- * interpret at least a dummy line while waiting for the first line of input
58
- * to be entered.
56
+ * classloading. To bridge the gap, we warm up the interpreter by letting
57
+ * it interpret at least a dummy line while waiting for the first line of
58
+ * input to be entered.
59
59
*/
60
60
val initialCommands : List [String ] =
61
61
" val theAnswerToLifeInTheUniverseAndEverything = 21 * 2" :: Nil
62
62
63
- /** We also allow the use of setting cleanup commands in the same manner.
64
- * This is mainly due to supporting the SBT options to specify these commands
63
+ /** Before exiting, the interpreter will also run the cleanup commands
64
+ * issued in the variable below. This is useful if your REPL creates
65
+ * things during its run that should be dealt with before shutdown.
65
66
*/
66
67
val cleanupCommands : List [String ] = Nil
67
68
68
- /** We also allow binding initial values */
69
+ /** Initial values in the REPL can also be bound from runtime. Override
70
+ * this variable in the following manner to bind a variable at the start
71
+ * of the REPL session:
72
+ *
73
+ * {{{
74
+ * override val boundValues = Array("exampleList" -> List(1, 1, 2, 3, 5))
75
+ * }}}
76
+ *
77
+ * This is useful if you've integrated the REPL as part of your project
78
+ * and already have objects available during runtime that you'd like to
79
+ * inspect.
80
+ */
69
81
val boundValues : Array [(String , Any )] = Array .empty[(String , Any )]
70
82
71
83
/** The default input reader */
0 commit comments