This directory contains the distribution of scm3a.  Scm conforms to
Revised^3.99 Report on the Algorithmic Language Scheme [Draft August
31, 1989] and the IEEE specification.  Scm runs under VMS, MS-DOS,
Unix and similar systems.

The author can be reached at jaffer@ai.mit.edu or
Aubrey Jaffer, 84 Pleasant St., Wakefield MA 01880.

			       MANIFEST

  The file `scm.exe', if present, is an IBM PC executable of scm.

  `README' is this file.  It contains a MANIFEST, INSTALLATION
	INSTRUCTIONS, and a TROUBLE SHOOTING GUIDE.
  `COPYING' details the LACK OF WARRANTY for scm and the conditions
	for distributing scm.
  `scm.1' is the unix style man page in nroff format.
  `scm.doc' is the text man page generated from scm.1.
  `MANUAL' details feature support and enhancements to Scheme and
	contains a SCHEME BIBLIOGRAPHY.
  `ChangeLog' documents changes to the scm.
  `code.doc' describes the internal representations and algorithms.
	Also describes how to modify scm.

  `test.scm' is Scheme code which tests conformance with Scheme
	specifications.
  `pi.scm' is Scheme code for computing digits of pi [type (pi 100 5)]
	which can be used to test the performance of scm against
	compiled C code [cc -o pi pi.c;time pi 100 5].
  `pi.c' is C code for computing digits of pi.

  `makefile.unix' is the file for building scm using the `make'
	program.
  `makefile.msc' is the file for building scm on an IBM PC using
	Microsoft C.
  `makefile.qc' is the file for building scm on an IBM PC using
	Microsoft QuickC.
  `makefile.bor' is the file for building scm on an IBM PC using
	Borland Turbo C.
  `VMSBUILD.COM' is the command file for building scm on a VMS machine.

  `setjump.h' and 'setjump.mar' provide setjmp and longjmp which do
	not use $unwind utility on VMS.

  `Init.scm' is Scheme initialization code.
  `config.h' is a C include file containing system dependent definitions.
  `patchlvl.h is the patchlevel of this release.
  `scm.h' has the data type and external definitions of scm.

  `scm.c' has the top level and interrupt code.
  `repl.c' has error, read-eval-print loop, timing and load code.
  `scl.c' has the code for utility functions which are not part of the
	IEEE Scheme spec or which are required for non-integer
	arithmetic.
  `eval.c' has the evaluator, apply, map, and foreach.
  `sys.c' has the code for call-with-current-continuation, input and
	output,	storage allocation and garbage collection.
  `subr.c' has all the rest of functions.

		      INSTALLATION INSTRUCTIONS

If scm is already built (compiled) skip to secton INSTALL.

These #defines should be checked before compilation.  The first 2 can
be defined either in the Makefile or config.h.  See config.h for more
information.

Makefile    config.h	note
------      ----	--------
-DIMPLINIT  IMPLINIT	directory and pathname where Init.scm will
			reside.
-DFLOATS    FLOATS	support for inexact numerical types.

DEST	    		directory where `make install' will put the
			executable.  Unix only.
MANDEST	    		directory where `make install' will put the
			unix style manual page.  Unix only.

These #defines are automatically generated by various preprocessors.
Scm uses them to find include files and the proper names for system
functions.  If one of these defines for your system type is missing on
your system, put -Dflag in the Makefile or #define flag in config.h.

define		note
------		--------
unix		most Unix and similar systems.
vms		(and VMS) VAX-11 C under VMS.
sparc		SPARC processor
hp9000s800	HP RISC processor
pyr		Pyramid 9810 processor
MSDOS		Microsoft C 5.10
_QC		Microsoft QuickC
__TURBOC__	Turbo C 2.0
__ZTC__		Zortech C
THINK_C		developement environment for the Macintosh

			      TO COMPILE

under UNIX and similar systems:
      cp makefile.unix Makefile
  Edit Makefile to change CFLAGS, LIBS, and especially IMPLINIT
      make
  Test scm
      scm
      (load "test.scm")
      (test-sc4)
      (test-cont)

under VMS:
  Edit CONFIG.H to set desired options and IMPLINIT
  Execute VMSBUILD.COM
      @VMSBUILD
  Test scm
      run scm
      (load "test.scm")
      (test-sc4)
      (test-cont)

under MSDOS:
  Copy the appropriate makefile to MAKEFILE:
    MAKEFILE.MSC for Microsoft C,
    MAKEFILE.BOR for Borland C, or
    MAKEFILE.QC for Quick C.
      COPY MAKEFILE.xxx MAKEFILE
  Edit MAKEFILE to set desired options and IMPLINIT
      MAKE
  Test scm
      SCM
      (load "test.scm")
      (test-sc4)
      (test-cont)

			       INSTALL

under UNIX

  Edit Makefile to have appropriate destinations for scm and scm.1.

      make install

  If IMPLINIT is not correctly defined in Makefile or config.h then
  you will need to define the environment variable SCM_INIT_PATH to be
  the full pathname of Init.scm.  In a csh init file (.cshrc) this is
  done by:
      set SCM_INIT_PATH /usr/src/scm/Init.scm

  Define the environment variable SCHEME_LIBRARY_PATH to be the full
  pathname of the Scheme Library directory if you have one.  In a csh
  init file (.cshrc) this is done by
      set SCHEME_LIBRARY_PATH /usr/lib/scheme/

under VMS:

  Put SCM.EXE, INIT.SCM, and COPYING someplace.  INIT.SCM and COPYING
  need to be in the same directory.  Either put SCM.EXE in a
  SYS$SYSTEM directory or, in your LOGIN.COM file, define the symbol
  SCHEME to be "$" appended to the full pathname of SCM.EXE.  For
  example:
      SCHEME == "$DKB100:[AUBREY.SCM]SCM.EXE"

  In your LOGIN.COM file define the environment SCM_INIT_PATH to be
  the full pathname of INIT.SCM.  For example:
      DEFINE SCM_INIT_PATH DKB100:[JAFFER.SCM]INIT.SCM
  Define SCHEME_LIBRARY_PATH to be the pathname of the Scheme Library
  if you have one.  For example:
      DEFINE SCHEME_LIBRARY_PATH DKB100:[JAFFER.SLIB]

under MSDOS:

  Put SCM.EXE, INIT.SCM, and COPYING someplace.  INIT.SCM and COPYING
  need to be in the same directory.  SCM.EXE needs to be in your
  search path.

  In AUTOEXEC.BAT define the environment variable SCM_INIT_PATH to be
  the full pathname of INIT.SCM.  For example:
      SET SCM_INIT_PATH=G:\AGJ\SCM\INIT.SCM

  In AUTOEXEC.BAT define the environment variable SCHEME_LIBRARY_PATH
  to be the full pathname of the Scheme Library directory if you have
  one.  For example:
      SET SCHEME_LIBRARY_PATH=G:\AGJ\SLIB\

			   TROUBLE SHOOTING

		Compiling:

FILE	ERROR or WARNING			HOW TO FIX

*.c	include file not found			fix #include statement
						or add #define for
						system type to config.h

scm.c	assignment between incompatible types	change SIGRETTYPE in scm.c
						
sys.c	statement not reached			ignore
	constant in conditional expression	ignore

scl.c	null body to function			define system type in
						config.h and scl.c (softtype)

		Linking:

ERROR or WARNING			HOW TO FIX

_iflo2str missing			delete object files and
(You changed FLOATS in config.h)	compile again. 

_sin missing, etc.			uncomment LIBS in makefile

		Running:

PROBLEM					HOW TO FIX

Opening message and then machine	Change memory model option
crashes.				to C compiler (or makefile).

					Make sure size_t definition is
					correct in config.h

					Reduce size of HEAP_SEG_SIZE
					in config.h

ERROR: Could not allocate ...		Check size_t definition.

					Get more memory.

... in config.h and recompile scm	Do it and recompile files.

ERROR: Init.scm not found		Assign correct IMPLINIT in
					makefile or config.scm or
					define environment variable
					SCM_INIT_PATH to be the full
					pathname of Init.scm (see
					INSTALLATION instructions).

WARNING: require.scm not found		define environment variable
					SCHEME_LIBRARY_PATH to be the
					full pathname of the scheme
					library or change
					library-vicinity in Init.scm
					to point to library or remove.

		Testing: (load "test.scm") or (load "pi.scm") (pi 100 5)

Runs some and then machine crashes.	See above under machine
					crashes.

Runs some and then ERROR: ...		Remove optimization option
					to C compiler and recompile.

Some symbol names print incorrectly.	Change memory model option
					to C compiler (or makefile).

					Check that HEAP_SEG_SIZE fits
					within size_t.

					Increase size of HEAP_SEG_SIZE
					(or INIT_HEAP_SIZE if it is
					smaller than HEAP_SEG_SIZE).

ERROR: Rogue pointer in Heap.		See above under machine
					crashes.

Newline or other characters don't	Check character defines in
print correctly.			config.h 

Spaces or control characters appear	Check character defines in
in symbol names				config.h

Negative numbers turn positive.		Check SRS in config.h
