Scheme - use car to display the first element of list

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

This is a simple demonstration of the car feature in scheme. The car command simply displays the first element of a list, no matter what it is, be it a character, symbol, int, or even another list. This is useful for streams later on.



(define a (list 1 2 3))
(write car a);prints 1

Questions/Comments: william_a_wilson@hotmail.com
-William. § (marvin_gohan)

Previous recipe | Next recipe |
 

Viewing 2 Comments

 
close Reblog this comment
blog comments powered by Disqus