smalltalk-72 instruction manual - · pdf file the smalltalk-72 instruction manual is intended...

Click here to load reader

Post on 07-Aug-2020

1 views

Category:

Documents

0 download

Embed Size (px)

TRANSCRIPT

  • SMALLTALK-72 INSTRUCTION MANUAL ADELE GOLDBERG AND ALAN KAY, EDITORS

    ~ ~

    \ \ \ \

  • SMALLTALK-72

    INSTRUCTION MANUAL

    Adele Goldberg and Alan Kay, editors

    and

    The Learning Research Group Xerox Palo Alto Hesearch Center

    March, 1976

    Copyright © 1976 by Xerox Corporation

  • SMALLTALK-72 INSTRUCTION MANUAL

    Adele Goldberg and Alan Kay, editors

    SSL 76-6 March, 1976

    The Smalltalk-72 instruction manual is intended for use by those persons with on-line access to the Xerox Interim Dynabook. The first two chapters consist of an introduction to some of the methods used for interacting with the Small talk system and for creating, editing, saving and retrieving Small talk programs. Chapter III goes deeper into the basic concepts from which everything else in Small talk is built. These include the method of evaluation of messages, message sending and receiving, and the notion of classes and instances.

    Many classes have already been built for the user's convenience. These include the various clal\ses for names, arithmetic, information storage methods, text display, and graphic control. The definitions of all of these basic classes is given in Chapter IV; Chapter V then presents a number of interesting examples that use these basic classes. Chapter IV also describes utilities already provided the user for editing definitions, saving and retrieving files of information, viewing definitions, testing values, and reading input devices.

  • Preface

    The Small talk system described here was designed in the summer of 1972 and first conversed haltingly with a user late that fall. It was released for more general use at the Xerox Palo Alto Research Center (PARe) in spring 1973 when the first "Interim Dynabook" (a name for the current working version of a small computer system) became available.

    This manual is intended for use by those persons with on-line access to the Interim Dynabook. As such, it employs a tutorial style that directs immediate experimentation with a Small talk systemj it also maintains a somewhat informal dialog about expected results of such experimentation. There are references to peripheral devices, such as a keyset, a mouse, a display screen, and a disk, that have meaning mainly in the context of the Interim Dynabook. Furthermore, the manual references disk files that are needed in order to follow the suggested sequence for experimentation and provides information on how to obtain these files. Such information is only useful to those persons having access to the Small talk system library.

    The purpose of making public an instructional manual about a language implemented on a computer not generally available is to ease the distribution of instructional information to school-age students (no younger than high school age) who will, in fact, have access to the Small talk system and materials noted here. Because an attempt is made to describe graphic results of running example programs, readers without access to the Small talk on-line materials may still gain some information about Small talk by browsing through these pages. Furthermore, the manual may assist these readers in developing their own experimental Small talk environment.

    Many people (both from the Learning Research Group and from other groups at PARC) have worked hard to develop the systems described in this manual and accompanying documents--the design and implementation of the Small talk language, real-time music synthesis, animation, retrieval methods, color graphics, and network communications. We take space here to mention their names: Dan Ingalls, Chris Jeffers, Ted Kaehler, Diana Merry, Dave Robson, John Shoch, Dick Shoup, and Steve Weyer of LRG; David Boggs, Bill Bowman, Bob Flegal, Larry Tesler, 'rruett Thach, and Bill Winfield of System Science Laboratory; and Patrick Baudelaire, Larry Clark, Jim Cucinitti, Peter Deutsch, Ed McCreight, Bob Metcalfe, Mike Overton, Bob Sproull, and Chuck Thacker of the Computer Science Laboratory.

    iii

  • TABLE OF CONTENTS

    Chapter I.

    INFORMAL ORIENTATION AND OVERVIEW OF THE SMALLTALK SYSTEM

    Introduction To Get Started The Mouse Talldng to Smalltalk Helpful Notes Try A Turtle Layout of the Small talk Screen Dialog Windows A First Note on Slnalltalk Classes Font Editing Windows

    initial comments on Smalltalk •••••••••••••••• l how to load a disk and get Smalltalk •••••••• 1 is what we point with ........................... 2 how to evaluate 3+4 ••••••••••••••••••••••••••••• 2 how to handle typing and other errors •••••• 2 make a square and a squiral ••• ••••••••••••••• 3 display screen coordinate system ............. 4 how to use some Small talk windows ••••••••• 5 what is a class dcfinition ••••••••••••••••••••••• 6 how to design characters ....................... 7

    Chapter II. WRITING SMALLTALK PROGRAMS

    Simple Manipulation of a Simple Program ..................................................... 9

    How to Edit Your Definition ......•........•.•..•.....•..•.••....•...••....••.....•.•.......••.•••. 10 GeneraliziIlg tIle Defini tion of Sq uare •....•...•....•.......•......•.••.............•.•.•• 11 FixiJlg YOllr Dialog ...........•...•.....•......•••....•.•.....••••.••.••...••................••.....••...• 13 Saving all{l Retrieving 11rograms .....•..............•......................................•..... 14 Diagllosis Window ........•••....••••.....••••••...••.•••..•...•••••.....•...••.•.•..•••.....•......••••••. 14 Special Cllaracters .....••••.•.••.•..•.....•.•••.••...••........••..•.•.•........•....•..................•.. 15

    Boxes: An Introduction to Small talk .............................................................. 17

    A Look at the Class Box ....•........•.••••.•...•....•.•••••..............•.•......•••••......•.•••.• 18 Alternative Box Definition .........•........•...•.•...•.•....•................•.•.•.•....•...•.••.• 24 Class of Polygons ...................•.......•...................•••.•..•.....................•.•....•....•. 26

    Turtles •• I. I I I ••••••••• I •••••• I ••••••••• I •• I •••••••••••••• I •••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 27

    Boxes Owning Turtles ..•......... 1 •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 29

    Dispframes: An In trod uction to Text Display .............................................. 30

    Placillg Text on the Display Screen •.•••....•...•••.•..•....................••.•......•..... 30 Boxes as MelIUS ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 32

    A Few Sketching Tricks ..................................................................................................... 36

    Paint Brush ......................................................................................................... 40

    BI"rBLTing .....••..............•...............•....•...•.•..............................•..•••.•...........•• 42

    iv

  • Chapter III. THE SMALLTALK WORLD AND ITS PRIMITIVES

    Objects ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••.•.••••••••••••••••••••••••••••••••• 44 Message Sending and Receiving •••..•.•••••••••••.•.•••••.••••••••••••••••••••••.•••••••••••••.•• 44 The Notion of a Class .••••..•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••.••••••••••• 48 The User Task ••.••••••••••••••.•••••••••••••• II II ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• 51 TIle Form of Presentation of Classes ••••.•••••••••••••••••••••••••••••••••••••••••••••••••••• 53 A Small talk Class Example •.••••••••••••••••••••••••