diff --git a/examples/comparison.lisp b/examples/comparison.lisp new file mode 100644 index 0000000..cbd60f2 --- /dev/null +++ b/examples/comparison.lisp @@ -0,0 +1,10 @@ +(eq 1 1) ; True +(eq 1 2) ; False + +(define a (λ () (+ 1 2 3))) +(define b (lambda () (+ 1 2 3))) +(eq a b) ; True + +(eq () nil) ; True + +(eq () (eval ())) ; True diff --git a/examples/define.lisp b/examples/define.lisp index 04d9686..c7b3df3 100644 --- a/examples/define.lisp +++ b/examples/define.lisp @@ -1,3 +1,3 @@ (define a 10) (define b 20) -(define c (+ a b)) \ No newline at end of file +(define c (lambda () (+ a b))) \ No newline at end of file diff --git a/examples/eval.lisp b/examples/eval.lisp new file mode 100644 index 0000000..6e4cca4 --- /dev/null +++ b/examples/eval.lisp @@ -0,0 +1,3 @@ +(eval + (quote + (+ 1 2))) \ No newline at end of file diff --git a/examples/lambda.lisp b/examples/lambda.lisp index 7cd4c43..30885e0 100644 --- a/examples/lambda.lisp +++ b/examples/lambda.lisp @@ -1,2 +1,7 @@ -(define a (λ () (+ 1 2 3))) -(a) \ No newline at end of file +(define a + (λ () + (+ 1 2 3))) + +(define b + (lambda () + (+ 1 2 3))) diff --git a/examples/repl.lisp b/examples/repl.lisp new file mode 100644 index 0000000..a0c3a2d --- /dev/null +++ b/examples/repl.lisp @@ -0,0 +1,9 @@ +(define repl + (lambda () ( + (print "λ -> ") + (print + (eval + (read))) + (print "\n") + (repl)))) +(repl)