BERKELEY LOGO INTERPRETER   Installation guide for Unix systems

 *	Copyright (C) 1993 by the Regents of the University of California
 *
 *      This program is free software; you can redistribute it and/or modify
 *      it under the terms of the GNU General Public License as published by
 *      the Free Software Foundation; either version 2 of the License, or
 *      (at your option) any later version.
 *  
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *  
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

This version of Logo is designed for a machine with adequate memory.  It is
not likely to be usable as the basis for a 64K microcomputer implementation.

The interpreter was written primarily by Daniel Van Blerkom, Brian Harvey,
Michael Katz, and Douglas Orleans.  Thanks to Fred Gilham for the X11 code.
Send comments by e-mail to bh@cs.berkeley.edu.


In addition to this README file you need the following source files:

		graphics.c	logo.h		makelib		parse.c
coms.c		ibmterm.c	logodata.c	math.c		print.c
error.c		ibmterm.h	macterm.c	mem.c		term.c
eval.c		init.c		macterm.h	nographics.c	wrksp.c
files.c		intern.c	main.c		nographics.h	xgraphics.c
globals.h	lists.c		makefile	paren.c		xgraphics.h

Edit the makefile to adjust its idea of where the X11 library and
header files live.

With these files in place you should be able to say "make" and get two
results: an executable file named "logo" and a subdirectory named "logolib"
containing some pseudo-primitive procedures written in Logo.  (Some of these
may be real primitives in later releases.)  If you would like to move the
Logo library to somewhere other than the source directory, you must edit
the file libloc.c (which was generated by make) and recompile.  The easiest
thing is if you just leave logolib where it is.

The distribution also includes the file "usermanual" which is a rather terse
description of this particular Logo dialect for people who already know how
to program in Logo.

To install Logo you need merely move the file "logo" to wherever you want it.

The files ztc* and mac* are for toy-computer versions of Logo.  But if you
are trying to compile for those machines you probably also need some extra
help beyond what's in here.  You can get complete PC and Mac versions by
anonymous FTP from anarres.cs.berkeley.edu.

----------

Here are the special features of this dialect of Logo:

	Random-access arrays.

	Variable number of inputs to user-defined procedures.

	Mutators for list structure (dangerous).

	Pause on error, and other improvements to error handling.

	Comments and continuation lines; formatting is preserved when
	procedure definitions are saved or edited.

	Terrapin-style tokenization (e.g., [2+3] is a list with one member)
	but LCSI-style syntax (no special forms except TO).  The best of
	both worlds.

	First-class instruction and expression templates.

	Macros.

----------

This program was developed on a VAX running 4.3BSD Unix.  Certain VAX
hardware misfeatures are handled in code that's compiled #ifdef vax.
Certain 4.3BSD features are used in code that's compiled #ifdef bsd.  The
variable bsd is set by #define in the file logo.h if either vax or sun is
defined.  If you are running on a 4.3 system not on a VAX or a Sun you might
wish to edit logo.h accordingly.  (Alternatively, you might want to define
the symbol sysv in logo.h if you're running on one of those.)  Here are all
the known system dependencies:

The constant WORDSIZE is defined to be 32 in logo.h and should be changed
if the number of bits in an int is different on your machine.

The file math.c contains VAX-specific code to enable integer overflow
interrupts; if an integer overflow occurs the operands are converted to
floating point and the operation is recomputed.  If you are not running on a
VAX but your machine requires some specific action to enable integer
overflow signalling, you may wish to install something similar.  Just look
for the "#ifdef vax" lines.

On the other hand, most machines these days don't provide integer overflow
interrupts no matter what.  Therefore, the default is that Logo tries to
figure out for itself whether or not an integer arithmetic operation would
lead to overflow.  For addition and subtraction, Logo plays with the signs
of the various quantities; for multiplication and INT, it just does the
operation in floating point to begin with, and converts back to integer if
possible.  Logo's idea of "if possible" depends on the value of MAXINT in
logo.h, which is 2^31-1 as distributed.

Also, the VAX Unix math library invokes a procedure infnan() in case of
illegal operands to a math function.  The library version of this procedure
causes an abort; math.c in Logo provides an alternative, for the VAX only,
that treats the problem like floating point overflow.

The Sun Unix math library invokes a procedure matherr() in case of math
function problems.  Logo provides, #ifdef sun, a version that silently turns
underflow into zero and gives a Logo-style error message, instead of the
system default C-style message and a funny answer, for everything else.

Different versions of Unix may differ in the completeness of their math
libraries.  Logo uses sin(), cos(), atan(), atan2(), sqrt(), exp(), log10(),
log(), pow(), drem(), ceil(), and floor().  If you are missing any of those
you will have to provide your own or turn off the corresponding Logo
primitive.  (Drem is used by the sin and cos primitives to reduce large
angle inputs to the range in which they can be converted accurately to
radians.  Ceil and floor are used by the int and round primitives when the
output is too large to fit in integer representation.)

The RANDOM and RERANDOM primitives use the 4.3BSD random() and srandom()
if bsd is defined, rather than the older rand() and srand().  The relevant
code is in math.c and init.c with #ifdef bsd.

The WAIT primitive uses the microsecond-resolution usleep() rather than the
second-resolution sleep() in coms.c if bsd is defined.

If your <sgtty.h> does not define FIONREAD, the ioctl that returns the number
of characters currently available from the keyboard, then the KEYP primitive
won't work.  The code in files.c prints a warning and returns TRUE in that
case.  (The idea is that hanging is a better fate than looping for your
Logo procedure.)

If your <sgtty.h> defines TIOCSTI, then it is used to simulate the user typing
a newline when she types the system interrupt or quit character while Logo is
waiting for keyboard input.  This gets Logo out of the pending read and allows
it to print a prompt.  If TIOCSTI is not defined, then Logo uses a kludge with
setjmp and longjmp instead.  The relevant code is in main.c, eval.c, files.c,
and parse.c.

If SYSV is defined, then term.c uses System V terminal control instead of
BSD-style terminal control.

European countries use an ISO extension of ASCII in which certain characters
have the 0200 (parity) bit set.  Logo ordinarily uses this bit to indicate
that the character was backslashed.  #ifdef ecma (set in logo.h) Logo uses
a more complicated encoding in which only characters with special syntactic
meaning are eligible for backslashing, and are represented by codes in the
range 0200-0237.  Characters above 0237 are considered ordinary letters.
This is conditionally compiled because it slows things down a little.
