In most programming languages, procedures are strongly typed, and any call to the procedure must use the same types that are used in the definition of the procedure. Thus, to reuse someone else's procedure, you must understand the types they use and conform to those types.
With views, you only need to describe how your data correspond to the abstract data used in the generic procedures. User interfaces are provided that make the views for you, either automatically or based on a few simple choices that you specify. There are two systems for making views: one for data structure views, and one for mathematical views.
Before making views, you must define your data structure(s). Then click the Make a View command. The system will present menus and/or a graphical interface to allow you to specify the view.
linked-list. The data structure views that are available include:
In general, these data structures contain pointers to other data of the same type. If your data structure contains such pointers, the view will be made using those pointers. Otherwise, the system will define a "carrier record" that contains your data plus the necessary pointers.
If there is more than one choice for an item, the system will present
a menu to allow you to select the choice to be made. In some cases, the
system can make the view automatically. In other cases, it will ask
questions, such as what field to sort on and whether the sort should
An example data declaration for a
person data structure is:
(person (name string) (age integer) (salary real) (friend (^ person)))This data structure could be viewed as a
friendpointer as the link field. It could also be viewed as a
sorted-linked-listwith sorting on
vectorabstract type used by the generic procedures is an (x,y) vector, but your vector type might be a polar (r,theta) vector.
The mathematical views that are available include:
When you request a mathematical view, a graphical window is created that
gives a diagram of the mathematical object and a menu of the fields
available from your data. The diagram contains labeled "buttons" for
parameters of the mathematical object. To make a view, click the mouse on
a diagram button; then click the corresponding item in the menu of your
data. A line is drawn between the selected items to show the correspondence.
When a sufficient definition of the object has been specified,
As a simple example, suppose that the data type
has been defined:
(pizza (diameter real) (topping string))To view a
circle, click the mouse on the
dbutton of the
circlediagram, then click the
diameterin the menu of the
pizzadata type. Then click the
Donecommand. Then you can select Make Programs to make a program to calculate, say, the