Scheme: Use Car to Display the First Element of List

Posted October 14, 2006 by admin in Computer programming

Last Updated on

This tutorial contains 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: [email protected]
-William. ยง (marvin_gohan)

The Conversation

Follow the reactions below and share your own thoughts.