	-*- Mode:Text; Package:USER -*-

	Conformance checker

		D.N.G. 11/8/89

Load the file sys:public.conformance;conformance.lisp.

Warning: Do NOT compile the above file in a buffer! You can
LOAD the xld file or COMPILE-FILE the lisp file, but if
the zmacs buffer is compiled it causes problems that are hard to
get out of.

Conformance checking can be enabled in any of the following four ways:

 1. Add the "Conformance" attribute to the mode line of a file that you
    want to be portable.  For example:

    ;;; -*- Mode:Common-Lisp; Package:User; Base:10.; Conformance:T -*-

    This will turn on conformance checking when the file is compiled by
    COMPILE-FILE or Compile Buffer, or when any portion of it is
    compiled by Compile Region.  Remember to do  

	META-X Reparse Attribute List
   
    after editing the mode list.

 2. Invoke COMPILE-FILE with keyword argument :CONFORMANCE true:

      (COMPILE-FILE <file> :CONFORMANCE T)

    If you just want to do error checking and conformance checking and
    don't need an object file to be written, you can save time by saying:

      (COMPILE-FILE <file> :CONFORMANCE T :OUTPUT-FILE :NONE)

 3. Use MAKE-SYSTEM, passing the :CONFORMANCE option to the compiler
    like this:

      (MAKE-SYSTEM <system> '(:RECOMPILE :CONFORMANCE T))

    or like this if you just want to do checking:

      (MAKE-SYSTEM <system>
		   '(:RECOMPILE :CONFORMANCE T :OUTPUT-FILE :NONE) 
		   :NOLOAD)

 4. Set the special variable COMPILER:*CONFORMANCE* true and then use
    COMPILE-FILE, MAKE-SYSTEM, or Compile Buffer.  This variable is the
    default value used when the option is not otherwise specified.


The value of the conformance option can be a symbol or string that is
STRING-EQUAL to any of the following values, depending on what you want to
conform to:

  NIL	-> No conformance checking is done.
  CLTL	-> Check conformance to "Common Lisp the Language", first edition (1984).
  ANSI	-> Check conformance to the proposed draft for ANSI standard Common Lisp.
  T	-> Warn about features not included in either CLtL or ANSI
	   Common Lisp.  Since most Common Lisp implementations are, or
	   soon will be, a mixture of the two dialects, this will most
	   often be what you want.
  CLTL+CLOS -> Same as :CLTL but allows CLEH symbols and compiler:*ok-symbols*.
	
  LUCID -> Warn about things not supported by Lucid Common Lisp (also
	   known as Sun Common Lisp).
  LISPWORKS -> Warn about things not supported by Harlequin LispWorks.
  ALLEGRO -> Warn about things not supported by Allegro Common Lisp
	   from Franz, Inc.

The last three options are implemented based on a very quick look at the
currently available documentation, and are not expected to be highly
accurate yet.


Following are some more hints for writing portable programs.

Make sure you are in Common Lisp mode.  Don't ever use "Mode:Lisp" in
the attribute line since that means Zetalisp.

Each file needs to begin with an IN-PACKAGE form since only Lisp
Machines recognize attribute lines.  In order to be compatible with both
CLtL and the ANSI standard, IN-PACKAGE should be called with just one
argument, which is a string or keyword.  You can use DEFPACKAGE to
create the file; it is not in CLtL but is in the ANSI standard.

When you define your package, use the COMMON-LISP package instead of the
LISP package.  The COMMON-LISP package exports all of the symbols
defined for the ANSI standard, including CLOS and the condition system,
while the LISP package has the just the CLtL symbols, some of which
conflict with the new condition system.  Don't use the TICL package
since it consists of extensions to Common Lisp.

Compiling your program with maximum safety, like in

  (COMPILE-FILE <file> :DECLARE '(OPTIMIZE SAFETY))

or

  (MAKE-SYSTEM <system> '(:COMPILE :DECLARE (OPTIMIZE SAFETY)))

will cause the compiled code to include run-time checks to ensure that
your data is consistent with the type declarations in the program.
[This feature is new in release 6.0.]  This can be very helpful for
finding problems that could be disastrous on a Lisp implementation on
conventional hardware.

When it does become necessary to use a feature that is implementation
dependent, use the #+ and #- reader macros to conditionalize the source.
For example:

  #+LispM (import '(zl:beep))
  #+Lucid (import '(lucid:beep))
  #-(or LispM Lucid)
  (defun beep () (write-char (code-char 7) *terminal-io*))

If you have made heavy use of such conditionals, you may want the compiler to
use the non-Explorer version of the source for conformance checking.  For
example, you could do 

  (LET ((*FEATURES* (SET-DIFFERENCE *FEATURES* '(:TI :EXPLORER :LISPM :LX))))
    (COMPILE-FILE <file> :CONFORMANCE T :OUTPUT-FILE :NONE))

in order to not get warnings about things that are already within a #+Explorer
conditional.  Note that *FEATURES* should only be altered when the option
:OUTPUT-FILE :NONE is being used.