scala/scala — pull request #2696 by som-snytt (2013-07-01 07:44:26+00:00)
Title: SI-4684 Repl supports whole-file paste

Add a file argument to the :paste command which loads the
file's contents as though entered in :paste mode.

The :paste command is replayable.

Samples, including companions defined together:

```
scala> :paste junk.scala
File contains no code: junk.scala

scala> :paste no-file.scala
That file does not exist

scala> :paste obj-repl.scala
Pasting file obj-repl.scala...
:2: error: expected start of definition
private foo = 7
^

scala> :paste hw-repl.scala
Pasting file hw-repl.scala...
The pasted code is incomplete!

:5: error: illegal start of simple expression
}
^

scala> :replay
Replaying: :paste junk.scala
File contains no code: junk.scala

Replaying: :paste obj-repl.scala
Pasting file obj-repl.scala...
defined trait Foo
defined object Foo

Replaying: Foo(new Foo{})
res0: Int = 7
```