git clone https://github.com/sri/golisp.git
cd golisp
export GOPATH=`pwd`
go test -v # optional. runs the tests
go build && ./golisp
Constants
LISP> nilnil
LISP> ()
nil
LISP> 11
LISP> 1.991.99
LISP> 'hello-world
hello-world
LISP> '(123)
(123)
LISP> (let (a 1) (+ a b c))
unidentified symbol: b
let Binding
LISP> (let (a 1 b 2 c 3) (+ a b c))
=> 6
String Concatenation
LISP> (s+ "Hello, ""world!")
"Hello, world!"
Lambdas
LISP> ((lambda (a b) (+ a b)) 12)
3
LISP> (lambda () 'a)
(lambdanil (quote a))
LISP> ((lambda () 'a))
a
If expressions
LISP> (if123)
2
LISP> (ifnil23)
3
Set/define variables and/or functions in current env
LISP> (def a 1)
1
LISP> (def b 2)
2
LISP> (+ a b)
3
LISP> (def a (lambda (x) (+ x 1)))
(Warning: shadowing var: a, current val: 1)
(lambda (x) (+ x 1))
LISP> (a 100)
101
LISP> (let (a 1) (def c 1000))
1000
LISP> c
unidentified symbol: c
LISP> (let (a 1) (def c 1000) c)
1000
LISP> c
unidentified symbol: c