- ;; This buffer is for text that is not saved, and for Lisp evaluation.
- ;; To create a file, visit it with C-x C-f and enter text in its buffer.
- '(1 2 3)
- (quote (1 2 3))
- '(a b c)
- (atom '(atom 'a))
- (atom '(3 4 5))
- (eq 'a 'b)
- (eq 1 1)
- (eq '(2 3) '(2 3))
- (car '(4 5 6))
- (cdr '(5 6 7))
- (cdr '( (2 3) (1 2) (5 6 7)))
- (cons '2 '(3 4 5))
- (cons '(1 2) '(3 4 5))
- (cond
- ( (eq 'a 'a) '3)
- ((eq '2 '2) '4))
- (defun double (x)
- (* 2 x))
- (double 3)
- (null '())
- (null '(1))
- (defun lat (l)
- (cond
- ((null l) t)
- ((atom (car l)) (lat(cdr l)))
- (t nil)
- )
- )
- (lat '(1 (2 3) 4))
- (and (atom 2) (atom 'a))
- (defun eqlist (l1 l2)
- (cond
- ( (and (null l1) (null l2)) t)
- ( (eq (car l1) (car l2)) (eqlist (cdr l1) (cdr l2)))
- (t nil)
- )
- )
- (eqlist '(1 2 3 4 5) '(1 2 3 4 5))
- (defun member2 (x l)
- (cond
- ( (null l) nil)
- ( (eq x (car l)) t)
- ( t (member2 x (cdr l)))
- )
- )
- (member2 '6 '(1 2 3 4 5))
- (not (eq 2 2))
- (defun nonlat (l)
- (cond
- ( (null l) t)
- ( (not (atom (car l))) (nonlat (cdr l)))
- ( t nil)
- )
- )
- (nonlat '(1 2 3))
- (nonlat '((2 3) 4 5 (5)))