

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


CS 3721: Programming Languages Lab Lab #01: Basic Scheme: learn a new language.
First, start the DrScheme programming environment. The environment has been installed on the Linux machines of the Computer Science department and you can start it by typing the “drscheme” command. You can also download DrScheme from http://www.drscheme.org to your own machines. The web site http://www.drscheme.org has comprehensive documen- tation both about DrScheme and about the Scheme language itself.
After the DrScheme environment starts, you will see two windows: the top window (called definition window) is for collectively entering programs and saving commands into files; the bottom interactive window is for experimenting with Scheme commands without saving them (your commands in the interactive window can use definitions in the definition win- dow). You should save all your code in the definition window into a file so that your work is not lost.
The Scheme language itself can have a few variations. For the purpose of our class, we would like to choose the language level to be “Teaching Languages: Intermediate Student with lambda” (you can choose the language level when you first start “drscheme” or by clicking the menu item “language:choose language”).
The purpose of this class is to lead you through the process of building simple Scheme programs. In a Scheme program, any line that begins with one or more semicolons is a comment:
; This is a comment. DrScheme will store it along with the rest of the ; text of a program, but does not even attempt to execute any part of it.
You should finish the following exercises by first experimenting in the interactive window, then saving your solution in the definition window with a comment above to indicate the corresponding exercise. If the exercise asks a question that needs to be answered in English (not in Scheme), provide your solution in the Scheme comments as well. After saving the solution for each question, click the ‘Run’ button at the top of the definition window to run your code. There should be no error messages.
In the following, we start with the most primitive concepts in Scheme.
Submission instructions: To submit, go to
http://www.cs.utsa.edu/~cs
and fill in the proper information. The instructor will give you a one-time username and password to submit successfully. Please make sure you fill in your name and email address correctly. Such information will be used to create a more permanent submission account for you.