Compare commits
2 commits
28abc474b0
...
30bdd44ba5
Author | SHA1 | Date | |
---|---|---|---|
able | 30bdd44ba5 | ||
able | 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)
|
7
lasp.S
7
lasp.S
|
@ -5,7 +5,7 @@ li64 r13, 0
|
|||
;; r253 will be the offset from the stack pointer specified by the spec to be r254
|
||||
li64 r253, 0
|
||||
|
||||
|
||||
; Load first char
|
||||
ldr r12, r13, lisp, 1
|
||||
|
||||
loop:
|
||||
|
@ -27,6 +27,7 @@ loop:
|
|||
; push the char onto the stack
|
||||
jmp push_u64_stack
|
||||
|
||||
; loop :skull:
|
||||
jmp loop
|
||||
|
||||
tx
|
||||
|
@ -63,10 +64,6 @@ closed_paren:
|
|||
jmp log_lisp_error
|
||||
|
||||
eval_stack:
|
||||
jmp pop_u64_stack
|
||||
jmp panic
|
||||
|
||||
panic:
|
||||
jmp log_lisp_error
|
||||
|
||||
lisp:
|
||||
|
|
Loading…
Reference in a new issue