home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 5
/
FreshFish_July-August1994.bin
/
bbs
/
dev
/
alst-3.04.lha
/
ALSt-3.04
/
manual.txt
< prev
next >
Wrap
Text File
|
1994-07-07
|
41KB
|
1,189 lines
LLLLiiiittttttttlllleeee SSSSmmmmaaaallllllllttttaaaallllkkkk UUUUsssseeeerrrrssss MMMMaaaannnnuuuuaaaallll ---- VVVVeeeerrrrssssiiiioooonnnn TTTThhhhrrrreeeeeeee
Tim Budd
Department of Computer Science
Oregon State University
Corvallis, Oregon
97331 USA
_A_B_S_T_R_A_C_T
Version three of Little Smalltalk was
designed specifically to be easy to port to new
machines and operating systems. This document pro-
vides the basic information needed to use Version
Three of Little Smalltalk, plus information needed
by those wishing to undertake the job of porting
the system to a new operating environment.
The first version of Little Smalltalk, although simple,
small and fast, was in a number of very critical ways very
Unix specific. Soon after the publication of the book _A
_L_i_t_t_l_e _S_m_a_l_l_t_a_l_k, requests started flooding in asking if
there existed a port to an amazingly large number of dif-
ferent machines, such as the IBM PC, the Macintosh, the
Acorn, the Atari, and even such systems as DEC VMS. Clearly
it was beyond our capabilities to satisfy all these
requests, however in an attempt to meet them partway in the
summer of 1988 I designed a second version of Little
Smalltalk, which was specifically designed to be less Unix
specific and more amenable to implementation of different
systems.
This document describes is divided into two parts. In
part one I describe the basic features of the user inter-
face. This is essential information for anybody wishing to
use the system. In part two we give the basic information
needed by anybody wishing to undertake the task of porting
version three Little Smalltalk to a new machine.
_1. _G_e_t_t_i_n_g _S_t_a_r_t_e_d
How you get started depends upon what kind of system
you are working on. Currently there are two styles of
interface supported. A line-oriented, tty style stdin
interface is available, which runs under Unix and other
July 7, 1994
- 2 -
systems. There is also a window based system which runs
under X-windows and on the Mac.
_1._1. _T_h_e _s_t_d_i_n/_s_t_d_o_u_t _i_n_t_e_r_f_a_c_e
Using the stdin/stdout interface, there is a prompt
(the ``>'' caracter) typed to indicate the system is waiting
for input. Expressions are read at the keyboard and
evaluated following each carrage return. The result of the
expression is then printed.
> 5 + 7
12
Global variables can be created simply by assigning to a
name. The value of an assignment statement is the value of
the right hand side.
x <- 3
3
Multiple expressions can appear on the same line separated
by periods. Only the last expression is printed.
y <- 17. 3 + 4
7
_1._2. _T_h_e _w_i_n_d_o_w_i_n_g _i_n_t_e_r_f_a_c_e
The windowing interface is built on top of guido van
rossums standard window package, and runs on top of systems
that support standard windows. These include X-11 and the
Macintosh.
When you start up the system, there will be a single
window titled ``workspace''. You can enter expressions in
the workspace, then select either the menu items ``do it''
or ``print it''. Both will evaluate the expression; the
latter, in addition, will print the result.
A number of other memu commands are also available.
These permit you to save the current image, exit the system,
or start the browser.
The browser is an interface permiting you to easily
view system code. Selecting a class in the first pane of
the browser brings up a second pane in which you can select
methods, selecting a method brings up a third pane in which
you can view and edit text. Selecting ``compile'' following
the editing of text will attempt to compile the method. If
no errors are reported, the method is then available for
execution.
July 7, 1994
- 3 -
_2. _E_x_p_l_o_r_i_n_g _a_n_d _C_r_e_a_t_i_n_g
This section describes how to discover information
about existing objects and create new objects using the Lit-
tle Smalltalk system (version three). In Smalltalk one com-
municates with objects by passing messages to them. Even
the addition message + is treated as a message passed to the
first object 5, with an argument represented by the second
object. Other messages can be used to discover information
about various objects. The most basic fact you can discover
about an object is its class. This is given by the message
ccccllllaaaassssssss, as in the following examples:
> 7 class
Integer
> nil class
UndefinedObject
Occasionally, especially when programming, one would
like to ask whether the class of an object matches some
known class. One way to do this would be to use the message
==== ====, which tells whether two expressions represent the same
object:
> ( 7 class = = Integer)
True
> nil class = = Object
False
An easier way is to use the message iiiissssMMMMeeeemmmmbbbbeeeerrrrOOOOffff::::;
> 7 isMemberOf: Integer
True
> nil isMemberOf: Integer
False
Sometimes you want to know if an object is an instance
of a particular class or one if its subclasses; in this case
the appropriate message is iiiissssKKKKiiiinnnnddddOOOOffff::::.
> 7 isMemberOf: Number
False
> 7 isKindOf: Number
True
All objects will respond to the message ddddiiiissssppppllllaaaayyyy by tel-
ling a little about themselves. Many just give their class
and their printable representation:
July 7, 1994
- 4 -
> 7 display
(Class Integer) 7
> nil display
(Class UndefinedObject) nil
Others, such as classes, are a little more verbose:
> Integer display
Class Name: Integer
SuperClass: Number
Instance Variables:
no instance variables
Subclasses:
The display shows that the class IIIInnnntttteeeeggggeeeerrrr is a subclass of
class NNNNuuuummmmbbbbeeeerrrr (that is, class NNNNuuuummmmbbbbeeeerrrr is the superclass of
IIIInnnntttteeeeggggeeeerrrr). There are no instance variables for this class,
and it currently has no subclasses. All of this information
could be obtained by means of other messages, although the
ddddiiiissssppppllllaaaayyyy form is the easiest. [ Note: at the moment printing
subclasses takes a second or two. I'm not sure why.]
> List variables display
links
> Integer superClass
Number
> Collection subClasses display
IndexedCollection
Interval
List
About the only bit of information that is not provided when
one passes the message ddddiiiissssppppllllaaaayyyy to a class is a list of
methods the class responds to. There are two reasons for
this omission; the first is that this list can often be
quite long, and we don't want to scroll the other informa-
tion off the screen before the user has seen it. The second
reason is that there are really two different questions the
user could be asking. The first is what methods are actu-
ally implemented in a given class. A