hazz/risp — pull request #6 by hazz (2013-11-27 17:23:56+00:00)
Title: Scheme compliance

This PR is an attempt to move pisp towards supporting Scheme. The aim is to get the 7 (8) primitive functions/operators working, so the rest of the standard library can be written in lisp. I'm basing it on [this paper](http://languagelog.ldc.upenn.edu/myl/ldc/llog/jmc.pdf). I'm also using [this online Scheme REPL](http://repl.it/languages/Scheme) to test code, which is really useful.

There are still some outstanding issues, but most of it works. The main ones are:
1. Comparing two identical symbols returns false
```(eq 'a 'a) => False```
2. Passing a lambda to another lambda doesn't work if you quote them
```((lambda (f) (f 1)) (lambda (x) (+ x 1)))``` works
```((lambda (f) (f 1)) '(lambda (x) (+ x 1)))``` crashes
But according to the paper you should quote the lambda, _however_ repl.it complains when you quote them, and works when you don't, so I'm inclined to go with that because a) I don't fully understand the whole quoting thing and b) if it ain't broke..

So in summary, new functions added:
`atom`
`cons`
`eq`
`cond`
`lambda`

Main architecture changes:
1. Ripped out `Literal` in favour of treating all literals (1, 2, etc) directly
2. Introduced a `Symbol` class to handle variables
3. Added a shorthand for `quote` which is to prepend an apostrophe to the list you want to quote. e.g.
`'a` becomes `(quote a)`
`'(1 2 3)` becomes `(quote (1 2 3))`
This is actually standard Scheme syntax
4. Tried to clean up the output you get when running some code.