© Nancy E. Reed, 1997 -- ECS 15 -- Fall 1997

Lecture 18 Notes
Programming Languages and Scheme Programming

Handouts:

Introduction

Most of the information covered in this lecture is included in the handouts listed above. See them for more details.

The Scheme Interpreter

There are two primary ways to interact with computer programming languages

Scheme has an Interpreter that follows the three step cycle shown below until you exit(by calling the function (exit)):
  1. Read an expression from the keyboard
  2. Evaluate the expression
  3. Print the results of the expression

One of the expressions you can evaluate (edwin) brings up the Edwin editor and allows you to edit files and evaluate the contents of the files in the interpreter.

Programs are composed of Procedures and Data

Computer programs contain primarily two categories of things - procedures (also called functions or subroutines) which contain some actions or computations to be performed, and data, which is stored in variables and constants. Variables (and constants) can contain numbers or text (strings), or large, more complicated information, as described in the data types section of your handout.

Variables are similar to nouns in natural languages -- they "store" information. Variables act like mailboxes - they have a name that is given to them when they are created, and they have "contents", with some data value. One can "see" the value when desired by looking in the mailbox with the correct name. One can also "remove" the current data and put "new" data in the mailbox in a fashion similar to letters in a real mailbox. We will see the categories of built-in data types available in Scheme shortly, including numbers and text (strings).

Procedures perform actions (similar to verbs in natural languages like English). Procedures contain sets of instructions (in a programming language) that the computer can perform - similar to a recipe in a cookbook that a cook can follow or the instructions to construct a model airplane from a kit. The categories of programming commands that are used to construct procedures and functions are in your handout.

Go to the index of lectures for ECS15 - Fall 1997 .

Go to the homepage for ECS15 - Fall 1997 .

© Nancy E. Reed, 1997 -- nereed@ucdavis.edu