government / src / internal / lisptest / testdata / lists.gov.lisp

@ 675167640370859e58d24a1f76126760c2e61968 | history


(cons 1 2)            ;=> (1 . 2)
(cons 1 '(2 3))       ;=> (1 2 3)
(cons 1 ())           ;=> (1)
(car '(a b c))        ;=> a
(cdr '(a b c))        ;=> (b c)
(cdr '(a))            ;=> ()
(car (cdr '(a b c)))  ;=> b
'(1 . (2 . (3 . ()))) ;=> (1 2 3)
'(1 2 . 3)            ;=> (1 2 . 3)

(car '())             ;=! car needs a pair
(cdr 5)               ;=! cdr needs a pair