jckarter/clay — pull request #416 by galchinsky (2012-10-14 14:52:06+00:00)
Title: Repl support: statements, imports, variables

Yet another try. Not much changes, but I merging becomes harder and harder, so please pull.

It seems to work with all except variant instances. Instances are needed to normal work of exceptions. Now it isn't work, so things like printer module should be load before repl starting. If you need to debug an existing module with REPL, it won't be a problem.

```
$ cat pr.clay
import printer.(println);
$cat one.clay
var x = 5;
addFive(y) = x + y;
$./clay -repl pr.clay
clay>record zar[T](a:T, b:T);
clay>println(zar[Int](1,2));
zar[Int32](1, 2)
clay>import one.(addFive);
clay>println(addFive(5));
10
```

To do list:
1. Add prelude.repl
2. add :rebuild command to repl that will compile all loaded things from scratch, so variant instances should work. Optional feature - all global variables workspace should be stored and loaded after rebuild. An alternative may be another representation of variants.
3. Add autoprinting if the line is an expression, not a statement
4. libedit support or something like that (what about windows users?)