Talk:Lisp (programming language): Difference between revisions

Content deleted Content added
Drj (talk | contribs)
m cdr was wrong
 
No edit summary
Line 42:
 
No, CDR stands for Contents of Data Register. Typo/thinko. Fixed. Ta. --[[drj]]
 
 
 
----
 
Function CAR in LISP program returns the first element in a list.
 
(car '(a b c d))
 
Returns a
 
Function CDR would return everything but the first element in a list.
 
(cdr '(a b c d))
 
returns (b c d)
 
There are of course many variations of this.
 
(cadr '(a b c d))
 
Returns b
 
Working from the inside out is the same as (car (cdr '(a b c d)))
 
----