More examples
This commit is contained in:
parent
28abc474b0
commit
3a37525c65
10
examples/comparison.lisp
Normal file
10
examples/comparison.lisp
Normal 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
|
|
@ -1,3 +1,3 @@
|
|||
(define a 10)
|
||||
(define b 20)
|
||||
(define c (+ a b))
|
||||
(define c (lambda () (+ a b)))
|
3
examples/eval.lisp
Normal file
3
examples/eval.lisp
Normal file
|
@ -0,0 +1,3 @@
|
|||
(eval
|
||||
(quote
|
||||
(+ 1 2)))
|
|
@ -1,2 +1,7 @@
|
|||
(define a (λ () (+ 1 2 3)))
|
||||
(a)
|
||||
(define a
|
||||
(λ ()
|
||||
(+ 1 2 3)))
|
||||
|
||||
(define b
|
||||
(lambda ()
|
||||
(+ 1 2 3)))
|
||||
|
|
9
examples/repl.lisp
Normal file
9
examples/repl.lisp
Normal file
|
@ -0,0 +1,9 @@
|
|||
(define repl
|
||||
(lambda () (
|
||||
(print "λ -> ")
|
||||
(print
|
||||
(eval
|
||||
(read)))
|
||||
(print "\n")
|
||||
(repl))))
|
||||
(repl)
|
Loading…
Reference in a new issue