mirror of
https://github.com/dschmenk/PLASMA.git
synced 2025-04-05 03:37:43 +00:00
Add list examplesd
This commit is contained in:
parent
0004ec0cd0
commit
5e00ed6a4d
19
src/lisp/list.lisp
Normal file
19
src/lisp/list.lisp
Normal file
@ -0,0 +1,19 @@
|
||||
(define
|
||||
(equal (lambda (x y)
|
||||
(cond ((and (atom x) (atom y)) (eq x y))
|
||||
((equal (car x) (car y)) (equal (cdr x) (cdr y)))
|
||||
(t f)
|
||||
))
|
||||
)
|
||||
(subst (lambda (x y z)
|
||||
(cond ((equal y z) x)
|
||||
((atom z) z)
|
||||
(t (cons (subst x y (car z)) (subst x y (cdr z))))
|
||||
))
|
||||
)
|
||||
(append (lambda (x y)
|
||||
(cond ((null x) y)
|
||||
(t (cons (car x) (append (cdr x) y)))
|
||||
))
|
||||
)
|
||||
)
|
Loading…
x
Reference in New Issue
Block a user