Home Computer programming Scheme: Use Car to Display the First Element of List

Scheme: Use Car to Display the First Element of List

0
596

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)

NO COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here

error: Content is protected !!