File README / Copyright (c) 1989 Jonathan Rees / See file COPYING

This is Pseudoscheme, developed by Jonathan Rees at the MIT AI Lab
(jar@zurich.ai.mit.edu).

Send mail to info-clscheme-request@mc.lcs.mit.edu to be put on a
mailing list for announcements.
----------

Here is some documentation.

Pseudoscheme has been tested in Symbolics CL, VAX LISP under VMS,
Explorer CL, Lucid on Sun, and a few other Common Lisps.  If you're
installing Pseudoscheme in some other version of Common Lisp, you may
have to customize a few things:
  - edit the definitions of SOURCE-FILE-TYPE and OBJECT-FILE-TYPE
    in "clever.lisp" as appropriate;
  - edit the definition of PREFERRED-CASE in "loadit.lisp" as appropriate;
  - rename file "clever.lisp" if necessary so that your Common Lisp's LOAD
    can find it given just the name "clever".
Send your customizations to jar@zurich.ai.mit.edu so that they can
be distributed to other people.

To load the system, first load the file "loadit.lisp", then do

    (schi:loadit "<dir>")

where <dir> is the directory in which Pseudoscheme is located.  Under
Unix, <dir> should include a final /, e.g. "/u/gjs/".  The first time
the system is loaded, it will compile itself.

Once the system is loaded, enter Scheme with

    (schi:scheme)

and leave Scheme with

    (quit)

There are definitions for everything that's in the Revised^3 Report on
the Algorithmic Language Scheme, although some definitions are
incomplete or approximate.  In particular, the arithmetic is Common
Lisp's, not Scheme's, and CALL-WITH-CURRENT-CONTINUATION is
implemented using Common Lisp BLOCK and is therefore not as general as
in a true Scheme.

In addition, the following nonstandard procedures are defined:

    quit              - leaves Scheme.
    compile-file      - compiles a file of Scheme code.  Arguments are as
			in Common Lisp's compile-file function.
    compile           - compiles one procedure, like Common Lisp's
			compile function.
    translate-file    - translates a file of Scheme code into Common Lisp.
			Output is written to a file with type ".pso"
			("Pseudoscheme output").
    pp                - prints something with
			  (let ((lisp:*print-pretty* t))  ...). 
    error             - signals an error, compatible with T, MIT Scheme,
		        and Common Lisp.

If you are using a Symbolics system, the first line of every Scheme source
file should be the following:

    ;-*- Mode: Scheme; Syntax: Scheme; Package: Scheme; -*-

WARNING: Tail recursion will work for ordinary loops written using
LETREC, internal DEFINE, or named LET; in other cases, however, you will
have true tail recursion only if the underlying Common Lisp supports it.

By default, procedure integration (inlining) is enabled for built-in
Scheme procedures like CAR and +, so doing SET! of these variables won't
have the correct effect.  To turn off inlining, do
(schi:set-rep-context! schi:scheme-user-context), and to turn it back on
do (schi:set-rep-context! schi:usual-context).

You can generally call Common Lisp functions from Scheme programs by
using package prefixes, e.g.

    (define (openit)
      (lisp:open "foo.txt" :direction :output))

Common Lisp special forms may or may not work in Scheme code, however,
because of the variable renaming that Pseudoscheme performs and its
implicit insertion of FUNCALL's and SPECIAL declarations.  If you need
to know, you can see what the translator does by doing (lisp:macroexpand
'<scheme-expression>).

You can do Common Lisp special binding from Scheme code using LET or
LAMBDA if the variable is not in the SCHEME package and the variable is
proclaimed special, e.g.

    (let ((lisp:*print-level* 10)) ...)

Symbols without explicit package prefixes are interned in a SCHEME
package and when used as bound variables will be renamed in some
circumstances.

If you need an EVAL procedure, try this:

    (define eval #'schi:scheme-eval)
    (define usual-context schi:usual-context)
    (eval '((lambda (x) (+ x 2)) 1)
	  usual-context)    =>  3

Macros (see "Syntactic Closures," 1988 LFP Conference, by Bawden and
Rees) and modules (vaguely similar to ML modules) exist in the
implementation, but are not yet supported or documented.
