Scheme – using cdr

Contributor Icon Contributed by William_Wilson Date Icon October 14, 2006  
Tag Icon Tagged: Computer programming

In Scheme, cdr simply displays all 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: william_a_wilson@hotmail.com
-William. ยง (marvin_gohan)

Previous recipe | Next recipe |
 
blog comments powered by Disqus