More examples

This commit is contained in:
able 2024-05-03 13:43:17 -05:00
parent 28abc474b0
commit 3a37525c65
5 changed files with 30 additions and 3 deletions

10
examples/comparison.lisp Normal file
View file

@ -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

View file

@ -1,3 +1,3 @@
(define a 10) (define a 10)
(define b 20) (define b 20)
(define c (+ a b)) (define c (lambda () (+ a b)))

3
examples/eval.lisp Normal file
View file

@ -0,0 +1,3 @@
(eval
(quote
(+ 1 2)))

View file

@ -1,2 +1,7 @@
(define a (λ () (+ 1 2 3))) (define a
(a) (λ ()
(+ 1 2 3)))
(define b
(lambda ()
(+ 1 2 3)))

9
examples/repl.lisp Normal file
View file

@ -0,0 +1,9 @@
(define repl
(lambda () (
(print "λ -> ")
(print
(eval
(read)))
(print "\n")
(repl))))
(repl)