lisp-列表

This is experimental prerelease support for the Windows platform: use
at your own risk.  "Your Kitten of Death awaits!"

0] (list 5 6 10)

(5 6 10)
0]


* (let ((x 15) (y 10) (xt 30) (yt 90)) (cons (+ x xt) (+ y  yt)))

(45 . 100)
* (cons 12 (+ 35 66))

(12 . 101)
* (cons 12 `(35 66))

(12 35 66)
* (defvar *mylist* (cons 12 (+ 12 22)))

*MYLIST*
* *mylist*

(12 . 34)
* (car *mylist*)

12
* (cdr *mylist*)

34

34
* (car '(11 454 155))

11
* (cdr '(23 234 1155))

(234 1155)

cadr就是先cdr,再car
cdar就是先car,再cdr
* (cadr `((55 234 77) (32 555 66)))

32
* (cdar `((55 234 77) (32 555 66)))

(234 77)
*

以此类推

0] (cadr `((55 234 77) 32 555 66))

32
0] (cddr `((55 234 77) 32 555 66))

(555 66)
0] (caddr `((55 234 77) 32 555 66))

555

0[2] (cdddr `((55 234 77) 32 555 66))

(66)
0[2]

你可能感兴趣的:(lisp)