[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Package failing validation function



    Date: Tue, 12 Jun 90 15:05 PDT
    From: snicoud@atc.boeing.com (Stephen L. Nicoud)

    I define a package called BECL which uses the CL package and the BECLI
    package (the latter exporting local extensions to Common Lisp).  From
    BECL I export all the symbols for which the CL package also exports plus
    the extensions.

    I also define a package called BECL-USER which uses BECL.  So here's the
    package hierarchy:

				    SCL   CL
				    |   /  |
				    |  /   |
				    BECLI  |
				    |      |
				     \    /
				      BECL
				       |
				       |
				   BECL-USER

    However, compiling (c-sh-d) or evaling (c-sh-e) in a zmacs buffer:

	(in-package :becl-user)

    results in this message appearing:

    Warning -- the value #<Package BECL-USER #o124336045> for GLOBAL:PACKAGE failed the validation function;
      the standard value for it will not be changed.

    Note, the attribute list is:

    ;;; -*- Mode: LISP; Syntax: Common-Lisp; Base: 10; Package: BECL-USER -*-

    If the attribute list is something else, say CL-USER, then no such
    warning message is displayed.  The warning message does appear when I
    compile the file for the zmacs buffer.

    What gives?  How can I fix this? 

    [Note: 3650, Genera 7.2]

When you compile or eval something from the buffer Zwei does a
SYS:STANDARD-VALUE-LET of all the variables corresponding to the
buffer's attribute list, so it effectively does

	(sys:standard-value-let ((*package* (find-package "BECL-USER")))
	  ...)

STANDARD-VALUE-LET is producing this warning.  When setting or binding
a standard value variable a validation function is run, and it checks
whether the value is reasonable for interactive use.  If it fails then
it arranges for the old value to be restored if you go into a break loop
or debugger (you'll get the warning "The following variables have been
rebound; use :Show Standard Value Warnings for details").

The validation function for *PACKAGE* checks whether it is one of a
known set of reasonable packages or :USEs one of them.  The intent of
this heuristic is to decide whether the user will be able to type most
ordinary Lisp forms and get the expected results; it has no way of
knowing that you've set up BECL and BECL-USER so that this is so.

This list is the variable SI:*REASONABLE-PACKAGES*, whose documentation
string is "Packages which contain a reasonable facsimile of the LISP
language."  Therefore, you should do

	(pushnew (find-package "BECL") SI:*REASONABLE-PACKAGES*)

                                                barmar