Previous Table of Contents Next


Smalltalk-76 was initially implemented on Altos. The Altos were robust machines, holding up to use by Xerox PARC administrators, secretaries, and researchers, as well as the large number of children and other visitors PARC hosted. LRG did a number of projects in Smalltalk-76 to test the breadth of applications that could be expressed easily with Smalltalk. One of these was an application to manage the book catalog of the PARC library. The application was actively used for a number of years. Most of the educational experimentation was done with specially conducted classes of students ages 12-13. These classes were held in cooperation with a local junior high school’s mentally gifted minors program. The students were driven to PARC during the school day. Saturday classes were held for the children of PARC employees.

These classes were productive in formulating a curriculum that led students from learning about line drawing, freehand painting and animation, to describing simple simulations and even tools (Goldberg & Ross, 1981). One student invented her own painting tools (remember, this is the mid-1970s, long before Apple introduced the Macintosh). Two students wrote papers, published in Creative Computing Magazine, about their experiences.

To broaden the school experience and to avoid the time spent transporting students, LRG planned to take several Altos to the junior high school. The plan was carried out, but not without a clash with SSL and PARC management on the topic of removing equipment from the PARC building. (The actual problem was likely whether Xerox had protected its proprietary interests in the hardware and software and had sufficient insurance, but was presented mostly as bureaucratic hesitation.) The school experience was delightful; it demonstrated the robustness of the Smalltalk-76 system under use in an open resource center of a public school. The system’s flexibility allowed the students to explore a wide range of simulation ideas. They wrote interactive games (Pong and various war-like games were typical), variations on the painting tool, and animations.

3.4.2. Smalltalk-76: The Language Definition

The primary designer of Smalltalk-76 was Dan Ingalls (Ingalls, 1978). The system was implemented in the Alto microcode as a byte-coded interpreter. Everything in Smalltalk-76 was an object, as everything in UNIX is a file, although some tricks were played to allow this metaphor to extend right down to the level of integer arithmetic. A class was created as an instance of the system class Class. You sent a class the message new to create an instance. Classes were objects, with a structure that encoded the inheritance hierarchy and a protocol that supported the creation and maintenance of their instances. The library contained about 50 classes representing all the operating system functions, files, network services, basic data structures, printing, editing applications, graphics, and user interface windowing system.

Because Smalltalk-76 provided a class hierarchy, the language included special variables self and super, each referring to the receiver of a message. The variable self indicated that the search for the appropriate method to execute should start in the class of the current receiver, and super indicated that the search should start in the message dictionary of the superclass. As part of eliminating the capability of objects to parse the message stream, Ingalls introduced the syntactic convention whereby message selectors consisted of a series of keywords, each ending with a colon to indicate that a value corresponding to a formal parameter was required. The colon was an obvious choice because it kept the familiar way in which parsing for the next argument to evaluate was done in Smalltalk-72. The up arrow continued to denote a return with value from the method, with the return value defaulted to self. The right arrow token (right arrow) continued to indicate a conditional expression, whereas repeat announced repetition. The open colon on a keyword allowed arguments to be passed unevaluated; blocks of code in square brackets could be passed in this manner for later evaluation. This syntax enabled users to create new control structures.

As a basis for comparing the syntax, the description of a Box class is shown here (note that Smalltalk-76 retained the use of an iconic font):

   Class new title:  ‘Box’;
          subclassof: Object;
          fields:   ‘size turt ;
          asFollows!
   initialization
          setValues           size ←  50. turt ← Turtle new.
   accessing
          position            ^ turt position
          position: aPoint    turt position: aPoint
          direction           ^turt direction
          size                ^size
   action
          move: dist          turt penup. turt go: dist. turt pendown.
   display
          hide                (turt color = #black) [turt white] turtblack.
                              self showBox.
                              (turt color = #black) [turt white] turtblack.
          show                super show. self showBox.
          showBox             1 to: 4 do: [turt go: size. turt turn: 90]

If joe is a variable name, then

   joe ← Box new.
   joe position: 10 @ 50.
   joe move: 10.

creates a new box, positions it at coordinates (10,50), and then moves the box by 10.

Notice that for the purposes of this example we continued to rely on turtle line drawing, although Smalltalk-76 provided a number of other drawing techniques, and we assumed that the turtle knew the window in which to draw.


Previous Table of Contents Next