Scheme: Using cdr

Posted October 14, 2006 by William_Wilson in Computer programming

In Scheme, cdr simply displays everything but the first element of a list, no matter what it is, be it a character, symbol, int, or even several lists or any combination. This is also useful for streams later on. This Tech-Recipe shows a simple demostration of the cdr feature in Scheme.



(define a (list 1 2 3))
(write (cdr a));writes (2 3)

Questions/Comments: [email protected]
-William. ยง (marvin_gohan)

The Conversation

Follow the reactions below and share your own thoughts.