[net.lang.st80] Smalltalk Notes

rentsch@unc.UUCP (Tim Rentsch) (11/04/86)

Copyright(c) 1986, by Tim Rentsch

Copyright Notice:  This memo is Copyright(c) 1986, by Tim Rentsch.
Copies may be made and distributed provided all of the following
conditions are met:  one, the copyright notice be included in its
entirety; two, the memo be copied (or distributed) in its entirety;
three, the memo be copied (or distributed) individually, i.e., not in
collection with other material; four, copies be made and distributed
one at a time, i.e., copies cannot be made or distributed in batches
of more than one; five, copies may not be sold -- distributing copies
is to be done at no cost to the recipients of the copies.  (End of
conditions, and end of copyright notice.)  




Note # 1:  Administrative Details
=================================

When you unpack your Smalltalk interpreter, you might find more
files than you expect.  Standard Smalltalk interpreters require four
(4) files just to start running.  For PS running on a sun-2 these
are:

	PS/PS.Sun2
	image/ST80-LV2.PS4
	image/ST80-LV2.sources
	image/ST80-LV2.changes

We will discuss momentarily the whys and wherefores of these files.
For now, however, you want to try out your smalltalk, and make it
easy for other people to try it too (but you also want to be careful
to leave the original files intact).  Here is how to do that.

First, create a directory, such as /usr/local/PS, to hold the
interpreter and related stuff.  That directory should look like this:

% ls /usr/local/PS
PS/	goodies/	image/

i.e., those are the directories on the tar tape.  [You might want to
make all the files gotten off the tar tape read-only.  You can do
this safely, but be warned:  if you do make the files read-only, you
may find that Smalltalk complains when you try to examine methods in
the browser.  Fear not -- merely hold down the left shift key when
bringing up the method.  A memo with a fix to this problem is in the
works.] 

Add a /usr/local/PS/bin/ directory, and put the following files in it
(suitably modified to reflect local directory names, obviously).  


file '/usr/local/PS/bin/setup'
--------------- CUT HERE ----------------------
#! /bin/csh -f
ln -s /usr/local/PS/image/ST80-LV2.PS4      .
ln -s /usr/local/PS/image/ST80-LV2.sources  .
ln -s /usr/local/PS/bin/st                  .
cp    /usr/local/PS/image/ST80-LV2.changes  .
chmod +w ST80-LV2.changes
--------------- CUT HERE ----------------------



file '/usr/local/PS/bin/st'
--------------- CUT HERE ----------------------
#! /bin/csh -f
if(  foo$1 == foo  )then
    set Image = ST80-LV2
    cp /usr/local/PS/image/ST80-LV2.changes .
else
    set Image = $1
endif
sun2
if( $status == 0 )then
    echo "(Unix  machine: SUN-TWO  image: $Image) runSmalltalk"
    /usr/local/PS/PS/PS.Sun2 $Image.PS4
else
    echo "(Unix  machine: SUN-THREE  image: $Image) runSmalltalk"
    /usr/local/PS/PS/PS.Sun3 $Image.PS4
endif
--------------- CUT HERE ----------------------


You (and your users) can now prepare to and actually run Smalltalk
easily, as for example the following:

% mkdir mysmalltalk
% cd mysmalltalk
% /usr/local/PS/bin/setup
% st


Discussion:
-----------

The intention of 'setup' is to make the installing of essential files
as painless and foolproof as possible.  After 'setup' is run, the
user merely has to be in his smalltalk directory and type 'st' to
run Smalltalk.  You might be tempted, by the way, to use hard rather
than soft links, or to use ~user rather than rooted file names.
Avoid these temptations.  The reasons for this have nothing to do
with Smalltalk, but with the "features" of SMI's network file system.

Also, 'setup' should definitely LINK the files and not COPY them.
Besides saving disk space, you as an administrator gain the ability
to change the scripts later on.  This has already been valuable to
us once when the Smalltalk directory had to be moved.

The intention of 'st' is, of course, to run Smalltalk.  The
particular 'st' given facilitates this in three ways:

(1) If no image file is named 'st' uses a default.  (You might note
also that in this case the '.changes' file is copied from the
original.  The reason for this is so that naive users don't have
'.changes' files which grow infinitely, which left to themselves they
will.  This will be discussed more in the next memo, where the
various files are described.)

(2) The extension .PS4 need not (must not) be typed by the user.
This may seem trivial, but it means the image name is the same as
the one typed when 'saving' an image in Smalltalk.  (I hate having
confused users.)

(3) 'st' does checking to see which machine it is on (sun-2 or
sun-3) and runs the particular interpreter appropriate for that
machine.  (The alternative is to have two scripts 'st2' and 'st3',
which we tried for a while.  You might want to make those scripts
available as well.)


Editorial
---------

You may wonder about the mysterious 'echo's in the 'st' script.
This is a kind of joke on the operating system, giving the command
to run Smalltalk in a Smalltalk-like syntax.  If it bothers you,
take it out;  I kinda like it myself.

More seriously, you might consider having 'setup' do more work.  One
obvious extension is to link a pointer to the 'goodies' directory in
along with all the other links.  Another is to add a link to a
common directory which is group writeable, to encourage sharing of
goodies in your local Smalltalk community.  Go ahead and add these
if you see fit, but don't worry about what decisions to make (or not
make) now;  remember that such things can all be changed after the
fact, by modifying 'st' to execute a new 'setup' (one side effect of
which will be to change the 'st' so that the new 'setup' gets
executed only once).  Clear?

Again, the 'st' script which runs Smalltalk is changeable by you
after the fact (and the changes will be felt everywhere instantly).
This will be useful when you prepare new "standard images" for your
local Smalltalk community.  They then can run the new image, complete
with bug fixes and enhancements, without doing anything special.  


(End of Note # 1)