Name: Anonymous 2007-09-20 21:14 ID:Rn5hE6lF
HOW DOES IT LOOK ?
--------------- ---------------- -------------------
| car | cdr | | car | cdr | | car | cdr |
| | o-------->| | o-------->| | nil |
| | | | | | | | |
--------------- ---------------- -------------------
COMMON-LISP package, and at the same time, it's agreed for it to represent an empty list.
;(car . cdr) is the dotted representation of a CONS pair = (cons car cdr)
;(a ... b) is a proper list
'() ;=> NIL
'(1) ;=> (1 . NIL)
'(1 2) ;=> (1 . (2)) => (1 . (2 . ())) or (1 . (2 . NIL))
'(A B C); => (A . (B . (C . NIL)))
#'first == #'car
#'rest == #'cdr
#'second == #'cadr == #'(lambda (x) (car (cdr x)))
; and so on...
<a title="zap colors" href="opera:/button/Go%20to%20page,%22javascript:(function()%257Bvar%2520newSS%252C%2520styles%253D'*%2520%257B%2520background%253A%2520white%2520!%2520important%253B%2520color%253A%2520black%2520!important%2520%257D%2520%253Alink%252C%2520%253Alink%2520*%2520%257B%2520color%253A%2520%25230000EE%2520!important%2520%257D%2520%253Avisited%252C%2520%253Avisited%2520*%2520%257B%2520color%253A%2520%2523551A8B%2520!important%2520%257D'%253B%2520if(document.createStyleSheet)%2520%257B%2520document.createStyleSheet(%2522javascript%253A'%2522%252Bstyles%252B%2522'%2522)%253B%2520%257D%2520else%2520%257B%2520newSS%253Ddocument.createElement('link')%253B%2520newSS.rel%253D'stylesheet'%253B%2520newSS.href%253D'data%253Atext%252Fcss%252C'%252Bescape(styles)%253B%2520document.getElementsByTagName(%2522head%2522)%255B0%255D.appendChild(newSS)%253B%2520%257D%2520%257D)()%253B%22,,%22Zap%20Colors%22,View">Zap colors</a>javascript:(function(){var newSS, styles='* { background: white ! important; color: black !important } :link, :link * { color: #0000EE !important } :visited, :visited * { color: #551A8B !important }'; if(document.createStyleSheet) { document.createStyleSheet("javascript:'"+styles+"'"); } else { newSS=document.createElement('link'); newSS.rel='stylesheet'; newSS.href='data:text/css,'+escape(styles); document.getElementsByTagName("head")[0].appendChild(newSS); } })();
"CUDDER". I put my "GRUNNER" all the way in it. That was the best night Leah ever had.
(3 4)
│
│
▼
((1 2) 3 4)┏━━━┳━━━┓ ┏━━━┳━━━┓ ┏━━━┳━━━┓
────►┃ ● ┃ ●─╂─────────────────►┃ ● ┃ ●─╂───►┃ ● ┃ ╱ ┃
┗━┿━┻━━━┛ ┗━┿━┻━━━┛ ┗━┿━┻━━━┛
│ │ │
▼ ▼ ▼
(1 2) ┏━━━┳━━━┓ ┏━━━┳━━━┓ ┏━━━┓ ┏━━━┓
────►┃ ● ┃ ●─╂───►┃ ● ┃ ╱ ┃ ┃ 3 ┃ ┃ 4 ┃
┗━┿━┻━━━┛ ┗━┿━┻━━━┛ ┗━━━┛ ┗━━━┛
│ │
▼ ▼
┏━━━┓ ┏━━━┓
┃ 1 ┃ ┃ 2 ┃
┗━━━┛ ┗━━━┛(cons (list 1 2) (list 3 4)).