Scheme
Last updated on 2025-07-01 | Edit this page
Estimated time: 40 minutes
Overview
Questions
- How can I write a scheme program
Objectives
- Learn to write a scheme program
Introduction
We will follow the introduction to scheme available at https://try.gambitscheme.org/.
This section will likely be updated. Encourage learners to type along with you, rather than hitting the run button. Do leave some time for discussion of the material.
Types
Challenge 1: Can you do it?
What is the difference between a list and a vector in scheme?
Lists are not indexed, one accesses the first and last items of a list. Vectors are indexed, any item can be accessed, but they are more expensive to process. Scheme is a programming language in the lisp family of programming languages (https://en.wikipedia.org/wiki/Lisp_(programming_language)), which extensively use lists.
Challenge 2: Can you do it?
Define an s-expression that uses the symbol + in a list that adds three numbers
Challenge 3: Can you do it?
check if + is a procedure. Use + to add three numbers in a list.
Key Points
- Scheme is a programming language that uses lists
- Scheme can be used to create very powerful compact programs
- Scheme has specifications which if implemented can be imported to give additional functionality such as formatted output
- Symbols can be used to create s-expressions that allow one to define and evaluate in separate steps