Wednesday, November 20, 2024
HomeComputer programmingScheme: Use Car to Display the First Element of List

Scheme: Use Car to Display the First Element of List

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)

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

LATEST REVIEWS

Recent Comments

error: Content is protected !!