From 6a28c3cec8b70a3626c76c1a97b221b8e87f3753 Mon Sep 17 00:00:00 2001 From: ram <ram> Date: Sat, 19 Oct 1991 16:46:52 +0000 Subject: [PATCH] Initial revision --- pcl/12-7-88-notes.text | 45 ++++ pcl/3-17-88-notes.text | 167 +++++++++++++ pcl/3-19-87-notes.text | 138 +++++++++++ pcl/4-21-87-notes.text | 53 ++++ pcl/4-29-87-notes.text | 80 ++++++ pcl/5-22-87-notes.text | 126 ++++++++++ pcl/5-22-89-notes.text | 152 ++++++++++++ pcl/8-28-88-notes.text | 537 +++++++++++++++++++++++++++++++++++++++++ pcl/cloe-low.lisp | 32 +++ pcl/kcl-notes.text | 38 +++ pcl/notes.text | 98 ++++++++ pcl/rel-8-patches.lisp | 255 +++++++++++++++++++ pcl/sysdef.lisp | 102 ++++++++ 13 files changed, 1823 insertions(+) create mode 100644 pcl/12-7-88-notes.text create mode 100644 pcl/3-17-88-notes.text create mode 100644 pcl/3-19-87-notes.text create mode 100644 pcl/4-21-87-notes.text create mode 100644 pcl/4-29-87-notes.text create mode 100644 pcl/5-22-87-notes.text create mode 100644 pcl/5-22-89-notes.text create mode 100644 pcl/8-28-88-notes.text create mode 100644 pcl/cloe-low.lisp create mode 100644 pcl/kcl-notes.text create mode 100644 pcl/notes.text create mode 100644 pcl/rel-8-patches.lisp create mode 100644 pcl/sysdef.lisp diff --git a/pcl/12-7-88-notes.text b/pcl/12-7-88-notes.text new file mode 100644 index 000000000..a9405156f --- /dev/null +++ b/pcl/12-7-88-notes.text @@ -0,0 +1,45 @@ +Copyright (c) Xerox Corporation 1988. All rights reserved. + + +These notes correspond to the "12/7/88 Can't think of a cute name PCL" +version of PCL. + +Please read this entire file carefully. You may also be interested in +looking at previous versions of the notes.text file. These are called +xxx-notes.text where xxx is the version of the PCL system the file +corresponds to. At least the last two versions of this file contain +useful information for any PCL user. + +This version of PCL has been tested at PARC in the following Common +Lisps: + + Symbolics 7.2 + Coral 1.2 + Lucid 3.0 + KCL (October 15, 1987) + Allegro 3.0.1 + +These three should work, but haven't been tested just yet. + + EnvOS Medley + TI + +The notes file hasn't yet been fleshed out yet. + +The two major changes in this release are: + + - The generic function cache algorithm has been revised. In addition + generic function caches now expand automatically. Programs that used + to run into problems with lots of cache misses shouldn't run into + those problems anymore. + + - the DEFCONSTRUCTOR hack now works. Please see the construct.lisp + file for details. If you are consing lots of instances, you may be + able to get a tremendous performance boost by using this hack. + + +Another important change is that this version includes some KCL patches +which dramatically improve PCL performance in KCL. See the kcl-mods.text +file for more details. + + diff --git a/pcl/3-17-88-notes.text b/pcl/3-17-88-notes.text new file mode 100644 index 000000000..7602fb07e --- /dev/null +++ b/pcl/3-17-88-notes.text @@ -0,0 +1,167 @@ +Copyright (c) Xerox Corporation 1988. All rights reserved. + +These notes correspond to the beta test release of March 17th 1988. +Later versions of this release will run in the usual lisps, but for the +time being this has only been tested in Symbolics, Lucid, Coral, +Xerox, Ibuki (01/01), TI and VAXLisp Common Lisps. + +Note may not run in all Franz Lisps, I believe it runs on the SUN3 +though. I will get back to this in a few days when I get the needed +code from Franz. + +*** +This release will run in Lucid 3.0 beta 2, with the boolean.lbin patch. + +*** +This release contains a prototype implementation of the make-instance +behavior documented in the CLOS specification (X3J13 document # 88-002). +This prototype implementation does not provide high performance, but it +should conform to the specification with one exception, it does not +check the validity of the initargs. + +All the generic functions in the instance creation protocol are as +specified in the CLOS specification except that make-instance is called +mki instead. This name is a temporary name, it is so that people can +try out the new make-instance protocol without having to convert all +their code at once. In a future release, the name make-instance will be +switched to the new behavior. + +*** +Standard method combination is supported. General declarative +method combination is not yet supported, so define-method-combination does +not yet work, but standard method combination is what generic functions +do by default now. :after :before :around and unqualified methods are +supported. Error checking is minimal. + +*** +call-next-method works with standard-method-combination. +call-next-method is much faster than it was before, and call-next-method +behaves as a lexically defined function. This means it is possible to +pass around funargs which include call-next-method. + +*** +All uses of slot-value within a method body should be optimized. It +should no longer be necessary to use with-slots just to get the +optimization. + +*** +There are new macros with-slots* and with-accessors*. These correspond +to the macros which will appear in the final specification, with-slots +and with-accessors. They work as follows: + +(with-slots* ((x x-slot) + (y y-slot)) ===\ (let ((#:g1 (foo))) + (foo) ===/ (swapf (slot-value #:g1 'x-slot) + (swapf x y)) (slot-value #:g1 'y-slot))) + +(with-accessors* ((x position-x) + (y position-y)) ===\ (let ((#:g1 (foo))) + (foo) ===/ (incf (position-x #:g1)) + (incf x) (incf (position-y #:g1))) + (incf y)) + +As an abbreviation, the (<variable-name> <slot-name>) pairs in with-slots* +can be abbreviated to just <variable-and-slot-name> when the variable +and slot name are the same. This means that: + +(with-slots* (x y z) <instance-form> &body <body>) + +is equivalent to: + +(with-slots* ((x x) (y y) (z z)) <instance-form> &body <body>) + +You should begin to convert your code to use these macros as soon as +possible since the old macro with-slots will swap names with with-slots* +sometime soon. + +A trick you may want to use for remembering the order of the first two +arguments to with-slots* and with-accessors* is that it is "like +multiple-value-bind". + +*** +In addition this release includes the beginnings of support for doing +some of the compiling which PCL does a load time at compile time +instead. To use this support, put the form: + + (pcl::precompile-random-code-segments) + +in a file which is compiled after all your other pcl using files are +loaded. Then arrange for that file to be loaded before all your +other pcl using files are loaded. + +For example, if your system has two files called "classes" and "methods", +create a new file called "precom" that contains: + + (in-package 'pcl) + + (pcl::precompile-random-code-segments) + + +Then you can use the defsystem stuff defined in the file defsys to +maintain your system as follows: + +(defsystem my-very-own-system + "/usr/myname/lisp/" + ((classes (precom) () ()) + (methods (precom classes) (classes) ()) + (precom () (classes methods) (classes methods)))) + +This defsystem should be read as follows: + +* Define a system named MY-VERY-OWN-SYSTEM, the sources and binaries + should be in the directory "/usr/me/lisp/". There are three files + in the system, there are named classes, methods and precom. (The + extension the filenames have depends on the lisp you are running in.) + +* For the first file, classes, the (precom) in the line means that + the file precom should be loaded before this file is loaded. The + first () means that no other files need to be loaded before this + file is compiled. The second () means that changes in other files + don't force this file to be recompiled. + +* For the second file, methods, the (precom classes) means that both + of the files precom and classes must be loaded before this file + can be loaded. The (classes) means that the file classes must be + loaded before this file can be compiled. The () means that changes + in other files don't force this file to be recompiled. + +* For the third file, precom, the first () means that no other files + need to be loaded before this file is loaded. The first use of + (classes methods) means that both classes and methods must be + loaded before this file can be compiled. The second use of (classes + methods) mean that whenever either classes or methods changes precom + must be recompiled. + +Then you can compile your system with: + + (operate-on-system 'my-very-own-system :compile) + +and load your system with: + + (operate-on-system 'my-very-own-system :load) + +*** +The code walker has gone through some signigificant revision. The +principle change is that the function walk-form now takes three required +arguments, and the walk-function itself now must accept an environment +argument. There are other changes having to do with the implementation +specific representation of macroexpansion environments. For details see +the file walk.lisp. + +*** +The following functions and macros which used to be supported for +backward compatibility only are now not supported at all: + +WITH* and WITH + +DEFMETH + +GET-SLOT + +MAKE + + +*** +There are other small changes in this release. If you notice one that +causes you problems please send me a message about it. + diff --git a/pcl/3-19-87-notes.text b/pcl/3-19-87-notes.text new file mode 100644 index 000000000..ce332f63a --- /dev/null +++ b/pcl/3-19-87-notes.text @@ -0,0 +1,138 @@ + + +These notes correspond to *pcl-system-date* 3/19/87 prime. + +This release runs in: + ExCL + Lucid + Symbolics Common Lisp (Genera) + Vaxlisp (2.0) + Xerox Common Lisp (Lyric Release) + +CMU Lisp (nee Spice) and KCL should be working soon, I will announce +another release at that time. I figured it was better to get some +people beating on it as soon as possibl. + +Xerox Lisp users should FTP all the source files from /pub/pcl/ as well +as all the dfasl files from /pub/pcl/xerox/. Included in the xerox +specific directory is a file called PCL-ENV, which provides some simple +environment support for using PCL in Xerox Lisp. + + + +Following is a description of some of the things that are different in +this release of PCL. This list isn't in any particular order. There +are a number of incompatible changes in this release, please read the +whole thing carefully. + +As usual, please enjoy, and send bug-reports, questions etc. to +CommonLoops@Xerox.com. + +*** +The single most significant change is that discriminator-objects with +corresponding discriminating functions have been replaced by generic +function objects. What does this mean?? Well, in previous releases of +PCL, if you did: + +(defmethod foo ((x class)) 'class) +(defmethod foo ((x method)) 'method) + +Then (discriminator-named 'foo) returned a discriminator object which +had both of these methods defined on it. (symbol-function 'foo) +returned a discriminating function, which (discriminator-named 'foo) had +put in foo's function cell. + +In this release of PCL, the above defmethod's put a generic-function +object in foo's function cell. This generic-function object is a +combination of the discriminator object and discriminating function of +the previous releases of PCL. This generic-function object is +funcallable, funcalling it causes the appropriate method to be looked up +and called. This generic function object has accessors which return the +methods defined on the generic function. This generic function object +is mutable. It is possible to add and remove methods from it. + +(defmethod foo ((x class)) 'class) +(defmethod foo ((x method)) 'method) + +(generic-function-methods #'foo) +(#<Method FOO (METHOD) 3434> #<Method FOO (CLASS) 3245>) + +(foo (make 'class)) ==> 'class +(foo (make 'method)) ==> 'method + +(remove-method #'foo (car (generic-function-methods #'foo))) + +(foo (make 'class)) ==> 'class +(foo (make 'method)) ==> no matching method error + + +Note that as part of this change, the name of any function, generic +function or class which included the string "DISCRIMINATOR" has changed. +The name changes that happened were: + The class essential-discriminator was renamed to generic-function, + The class basic-discriminator and the class discrimiantor were + combined and renamed to standard-generic-function. + +If you went through your code and made the following name changes, you +would probably win, (this is what I did to PCL and it worked). + + essential-discriminator ==> generic-function + basic-discriminator ==> standard-generic-function + discriminator + (when it appears as a specializer) + ==> standard-generic-function + discriminator + (when it appears as part of a variable name or something) + ==> generic-function + +*** +In most Lisp implementations, method lookup is at least twice as fast as +it was in the previous release. + +*** +The compiler isn't called when PCL is loaded anymore. In a future +release, the compiler will also not be called when any other method +definitions are loaded. This is part of an effort to get PCL to a state +where the compiler will never be needed when compiled files are loaded. + +*** +PCL now has a mechanism for naming the generic-function's and method +functions defined by defmethod. This means that in ports of PCL which +take advantage of this mechanism, you will see useful function names in +the debugger rather than the useless gensym names that have been in the +past few releases. + +*** +Compiled files containing defmethod forms should be smaller and load +faster. + +*** +Many of the files in the system have been renamed. More files will be +renamed in upcoming releases. + +*** +An important part of the bootstrapping code has been re-written. The +remainder of this code (the BRAID1 and BRAID2 files) will be re-written +sometime soon. + +The changes made to bootstrapping in this release were done to make +early methods more understandable, and as part of implementing generic +function objects. Also, most users should find that PCL loads in less +time than it did before. + +The changes which will be made to bootstrapping in a future release will +make understanding the "Braid" stuff easier, and will make it possible +to implement slot-description objects as described in the CURRENT DRAFT +of the Common Lisp Object System Chapter 3. + +*** +The defsys file has been re-written AGAIN. This shouldn't affect users +since there are still the old familiar variables *pcl-pathname-defaults* +and *pathname-extensions*. + +*** +The specialized foo-notes files are all gone. Most of them were +hopelessly out of date, and installing pcl is now the same operation for +any Lisp. In particular, note that in Vaxlisp, it is no longer +necessary to push lisp:vaxlisp on the *features* list. + diff --git a/pcl/4-21-87-notes.text b/pcl/4-21-87-notes.text new file mode 100644 index 000000000..b1acd73f5 --- /dev/null +++ b/pcl/4-21-87-notes.text @@ -0,0 +1,53 @@ + + +These notes correspond to *pcl-system-date* "4/21/87 April 21rst 1987". + +The notes from the last release are stored as 3-19-notes.text + +This release runs in: + ExCL + Lucid + Symbolics Common Lisp (Genera) + Vaxlisp (2.0) + Xerox Common Lisp (Lyric Release) + Kyoto Common Lisp (5.2) + +CMU Lisp (nee Spice) should be working soon, I will announce another +release at that time. + +Xerox Lisp users should FTP all the source files from /pub/pcl/ as well +as all the dfasl files from /pub/pcl/xerox/. Included in the xerox +specific directory is a file called PCL-ENV, which provides some simple +environment support for using PCL in Xerox Lisp. + + +The major difference in this release is that defclass conforms to the +CLOS specification (pretty much I hope). Previous warnings about what +would happen when defclass became CLOS defclass now apply. Once major +difference is that PCL currently does require that all a classes +superclasses be defined when a defclass form is evaluated. This will +change sometime soon. + +Other small changes include: + +Some more of the files have been renamed and restructured (as promised). + +the defclass parsing protocol has changed + +slotd datastructures are now instances of the class +standard-slot-description. + +a performance bug in the ExCL port which causes method lookup and slot +access to cons needlessly. + +a bug in the 3600 port which broke the printer for stack consed closures + +make-specializable + +a bug in Lucid lisp which made it impossible to say (compile-pcl) has +been patched around, this is the bug that manifested itself as NAME +being ubound. + + +As usual, please enjoy and send comments. + diff --git a/pcl/4-29-87-notes.text b/pcl/4-29-87-notes.text new file mode 100644 index 000000000..307b86e86 --- /dev/null +++ b/pcl/4-29-87-notes.text @@ -0,0 +1,80 @@ + + +These notes correspond to *pcl-system-date* "4/29/87 prime April 29, 1987". + +The notes from the last release are stored as 4-21-notes.text + +This release runs in: + ExCL + Lucid + Symbolics Common Lisp (Genera) + Vaxlisp (2.0) + Xerox Common Lisp (Lyric Release) + Kyoto Common Lisp (5.2) + TI Common Lisp (Release 3) + +CMU Lisp (nee Spice) should be working soon, I will announce another +release at that time. + +TI release 2 should also be working soon, I will announce that when it +happens. + + +Note once again, that Xerox Lisp users should FTP all the source files +from /pub/pcl/ as well as all the dfasl files from /pub/pcl/xerox/. +Included in the xerox specific directory is a file called PCL-ENV, which +provides some simple environment support for using PCL in Xerox Lisp. +You must load PCL BEFORE loading pcl-env. + + +MAJOR CHANGES IN THIS RELEASE: + + make has been renamed to make-instance + + make-instance has been renamed to allocate-instance + +for compatibility, make can continue to be used as a synonym for +make-instance. unfortunately, code which used to call make-instance +must be converted. + +I would actually suggest that you do both of these name changes right +away. Two passes through the code using Query Replace seems to work +quite well (changing make-instance to allocate-instance and then make to +make-instance.) I was able to change all of PCL in about 10 minutes +that way. + +--- + +all functions and generic functions whose name included the string +"get-slot" have been renamed. Basically, get-slot was replaced +everywhere it appeared with slot-value. + +get-slot itself still exists for compatibility, but you should start +converting your code to use slot-value. + + + +OTHER CHANGES in this release: + +There is a new file called PKG which does the exports for PCL. PCL now +exports fewer symbols than before. Specifically, PCL now exports only +those symbols documented in the CLOS spec chapters 1 and 2. This means +that some symbols which may be needed by some programs are not exported. + +A good example is print-instance. print-instance is not exported and +since print-instance has not yet been renamed to print-object programs +which define methods on print-instance may want to import that symbol. + +--- + +pcl should load faster in this release. In particular, the file fixup +should load in less than half the time it did before. This release +should load in something like 80% of the time it took in the last +release. Remember, these numbers are only for comparison, your mileage +may vary. + +--- + +This release of PCL, as well as the last one, has *pcl-system-date* +which presents the date in both mm/dd/yy and Month day year format. + diff --git a/pcl/5-22-87-notes.text b/pcl/5-22-87-notes.text new file mode 100644 index 000000000..01aed9fd0 --- /dev/null +++ b/pcl/5-22-87-notes.text @@ -0,0 +1,126 @@ + + +These notes correspond to *pcl-system-date* "5/22/87 May 22nd, 1987". + +The notes from the last release are stored as 4-29-notes.text + +This release runs in: + CMU Lisp + ExCL + Lucid + Symbolics Common Lisp (Genera) + Vaxlisp (2.0) + Xerox Common Lisp (Lyric Release) + Kyoto Common Lisp (5.2) + TI Common Lisp (Release 3) + +TI release 2 should also be working soon, I will announce that when it +happens. + + +Note once again, that Xerox Lisp users should FTP all the source files +from /pub/pcl/ as well as all the dfasl files from /pub/pcl/xerox/. +Included in the xerox specific directory is a file called PCL-ENV, which +provides some simple environment support for using PCL in Xerox Lisp. +You must load PCL BEFORE loading pcl-env. + + +MAJOR CHANGES IN THIS RELEASE: + +--- + it is possible to forward reference classes in a defclass (or + add-named-class) form. This means it is possible to say: + + (defclass foo (bar) (i j k)) + + (defclass bar () (x y z)) + + Rather than having to put the in the "right" order. + + NOTE: the full-on error checking for this is not finished yet. + don't try to break it by doing things like: + + (defclass foo (bar) (i j k)) + (make-instance 'foo) + (defclass bar () (x y z)) + +--- + print-instance has been renamed to print-object + +--- + the defclass and class-definition protocol has changed. some of the +effects of this change are: + +* ADD-NAMED-CLASS is a true functional interface for defclass, so for + example, + + (defclass foo () (x y z) (:accessor-prefix foo-)) + + is equivalent to: + + (add-named-class (class-prototype (class-named 'class)) + 'foo + () + '(x y z) + '((:accessor-prefix foo-))) + +* defclass (and add-named-class) now undefined accessor methods, reader + methods and constructors which 'went away'. For example: + + (defclass foo () (x y z) (:reader-prefix foo-)) + + defines methods on the generic functions foo-x foo-y and foo-z. + + but if you then evaluated the defclass form: + + (defclass foo () (x y z)) + + those reader methods will be removed from the generic functions + foo-x foo-y and foo-z. + + Similarly constructors which 'went away' will be undefined. + +--- + writer methods generated by the :accessor and :accessor-prefix options + now pay attention to the :type slot-option. So, + + (defclass foo () ((x :accessor foo-x :type symbol))) + + (defvar *foo-1* (make-instance 'foo)) + + (setf (foo-x *foo-1*) 'bar) ; is OK + + (setf (foo-x *foo-1*) 10) ; signals an error + +--- + There are fewer built-in classes. Specifically, only the following + Common Lisp types have classes: + + ARRAY BIT-VECTOR CHARACTER COMPLEX CONS FLOAT INTEGER LIST + NULL NUMBER RATIO RATIONAL SEQUENCE STRING SYMBOL T VECTOR + +* In a future release the subtypes of FLOAT may have classes, that issue + is still under discussion. + +* Some ports of PCL also define classes for: + + HASH-TABLE PACKAGE PATHNAME RANDOM-STATE READTABLE STREAM + + it depends on how the type is represented in that Lisp's type system. + + +--- + The with-slots option :use-slot-value is now obsolete. You should use + the :use-accessors option as specified in the CLOS spec instead. + + with-slot forms which did not use the :use-slot-value option are OK, + you don't have to touch them. + + with-slot forms which used :USE-SLOT-VALUE T should be changed to say + :USE-ACCESSORS NIL. + + with-slot forms which used :USE-SLOT-VALUE NIL should be changed to + use neither option, or if you insist :USE-ACCESSORS T + + + diff --git a/pcl/5-22-89-notes.text b/pcl/5-22-89-notes.text new file mode 100644 index 000000000..3f198d8a1 --- /dev/null +++ b/pcl/5-22-89-notes.text @@ -0,0 +1,152 @@ +Copyright (c) Xerox Corporation 1989. All rights reserved. + +These notes correspond to the "5/22/89 Victoria PCL" version of PCL. + +Please read this entire file carefully. Failure to do so guarantees +that you will have problems porting your code from the previous release +of PCL. + +You may also be interested in looking at previous versions of the +notes.text file. These are called xxx-notes.text where xxx is the +version of the PCL system the file corresponds to. At least the last +two versions of this file contain useful information for any PCL user. + +This version of PCL has been tested at PARC in the following Common +Lisps: + + Symbolics 7.2, 7.4 + Coral 1.2 + Lucid 3.0 + IBCL (October 15, 1987) + Allegro 3.0.1 + Golden Common Lisp 3.1 + EnvOS Medley + +These should work, but haven't been tested yet: + + TI + +This release is similar to Cinco de Mayo and Passover PCL. The major +difference is that this release actually works. + +*** + +*other-exports* flushed. More exports now on *exports* + +The symbol STANDARD is now exported from the PCL package. standard-class +standard-method standard-generic-function standard-object built-in-class +structure-class + +scoping problem with *next-methods* + + +method and generic function initialization protocol + +methods are immutable + +type-specifiers --> specializers + +load-truename etc. + +defgeneric ensure-generic-function define-method-combination + +metabraid changes + +file namings + +*** + +There are a number of minor and one major difference between this +release and No Cute Name PCL. + + +- In the last release there was an implementation of the specified CLOS +initialization protocol. This implementation had the correct behavior, +but some of the generic functions had temporary names (*make-instance, +*initialize-instance and *default-initargs). This was done to give +people time to convert their code to the behavior of the new +initialization protocol. + +In this release, all generic functions in the specified initialization +protocol have their proper names. The implementation of the old, +obsolete initialization protocol has disappeared entirely. + +The following renamings have happened: + + 12/7/88 release this release + + *make-instance make-instance + *initialize-instance initialize-instance + *default-initargs default-initargs + +The functions shared-initialize and reinitialize-instance already had +the proper names. + +The new initialization protocol is documented fully in the 88-002R +specification. + +As part of this change, PCL now uses the new initialization protocol to +create metaobjects internally. That is it calls make-instance to create +these metaobjects. The actual initargs passed are not yet as specified, +that will be in a later release. + +This is the largest change in this release. If you have not already +started using the new initialization protocol (with the temporary *xxx +names) you are going to have to do so now. In most cases, old methods +on the generic functions INITIALIZE, INITIALIZE-FROM-DEFAULTS and +INITIALIZE-FROM-INIT-PLIST must be substantially rewritten to convert +them to methods on INITIALIZE and SHARED-INITIALIZE. + +- slots with :ALLOCATION, :CLASS now inherit properly. As part of this +change, some slot description objects now return a class object as the +result of SLOTD-ALLOCATION. + +- There is now a minimal implementation of the DEFGENERIC macro. This +implementation supports no options, but it does allow you to define a +generic function in one place and put some comments there with it. + +- The following functions and macros have disappeared. This table also + show briefly what you use instead. + + DEFMETHOD-SETF (use DEFMETHOD) + RUN-SUPER (use CALL-NEXT-METHOD) + OBSOLETE-WITH-SLOTS (use WITH-SLOTS or WITH-ACCESSORS) + SYMBOL-CLASS (use FIND-CLASS) + CBOUNDP (use FIND-CLASS) + CLASS-NAMED (use FIND-CLASS) + GET-SETF-GENERIC-FUNCTION (use GDEFINITION) + +- In certain ports, method lookup will be faster because of a new scheme +to deal with interrupts and the cache code. In other ports it will be +slightly slower. In all ports, the cache code now interacts properly +with interrupts. + +- DEFMETHOD should interact properly with TRACE, ADVISE etc. in most +ports. two new port-specific functions (in defs.lisp) implement this. +These are unencapsulated-fdefinition and fdefine-carefully. If this +doesn't work properly in your port, fix the definition of these +functions and send it back so it can be in the next release. + +- This release runs in Golden Common Lisp version 3.0. + +- Previously, the use of slot-value (or with-slots) in the body of a +method which had an illegal specializer gave strange errors. Now it +gives a more reasonable error message. + +- An annoying problem which caused KCL and friends to complain about +*exports* being unbound has been fixed. + +- The walker has been modified to understand the ccl:%stack-block +special form in Coral Common Lisp. + +- The use of defadvice in pre 3.0 releases has been fixed in Lucid Low. + +- multiple-value-setq inside of with-slots now returns the correct +value. + +- A minor bug having to do with macroexpansion environments and the KCL +walker has been fixed. + +- A bug in the parsing of defmethod which caused only symbols (rather +than non-nil atoms) to be used as qualifiers. + diff --git a/pcl/8-28-88-notes.text b/pcl/8-28-88-notes.text new file mode 100644 index 000000000..854a90bcf --- /dev/null +++ b/pcl/8-28-88-notes.text @@ -0,0 +1,537 @@ +Copyright (c) Xerox Corporation 1988. All rights reserved. + + +These notes correspond to the "8/24/88 (beta) AAAI PCL" version of PCL. + +Please read this entire document carefully. + +There have been a number of changes since the 8/2/88 version of PCL. As +usual, these changes are part of our efforts to make PCL conform with +the CLOS specicification (88-002R). This release contains the big +changes which the 7/7 through 8/2 releases were really getting ready +for. + +This version of PCL has been tested at PARC in the following Common +Lisps: + + Symbolics 7.2 + Coral 1.2 + Lucid 3.0 + Franz ?? + Xerox Lyric + Xerox Medley (aka EnvOS Medley) + KCL (October 15, 1987) + + +Most of the changes in this version of PCL fall into one of two +categories. + +The first major set of changes makes the order of arguments to setf +generic functions and methods conform with the spec. In addition, these +changes allow the first argument to defmethod to be of the form (SETF +<symbol>). + +The second major set of changes have to do with slot access and instance +structure. Importantly, PCL now checks to see if a slot is bound, and +calls slot-unbound if the slot is unbound. This is a major change from +previous releases in which slot access just returned NIL for slots which +had not yet been set. These changes affect all the functions which +access the slots of an instance. In addition, the generic functions +which are called by the slot access functions in exceptional +circumstances are affected. This set of changes also include the +implemenentation of the real initialization protocol as specified by +88-002R. + +In addition, there are a number of other changes. The most significant +of these has to do with the symbols which the PCL package exports by +default. + +The rest of this document goes on to first describe the slot access +changes, then describe the setf generic function changes, and finally +describe some of the other minor changes. + +At the very end of this file is a new section which lists PCL features +which are scheduled to disappear in future releases. Please read this +section and take it to heart. This features will be disappearing. + + +*** Changes to slot access and instance structure *** + +This release includes a number of changes to the way slot access works +in PCL. Some of these changes are incompatible with old behavior. Code +which was written with the actual CLOS spec in mind should not be +affected by these incompatible changes, but some older code may be +affected. + +The basic thrust of the changes to slot access is to bring the following +functions and generic functions in line with the specification: + + slot-boundp + slot-exists-p + slot-makunbound + slot-missing + slot-unbound + slot-value + + slot-boundp-using-class + slot-exists-p-using-class + slot-makunbound-using-class + slot-value-using-class + + (setf slot-value) + (setf slot-value-using-class) + + change-class + make-instances-obsolete + + make-instance (temporarily called *make-instance) + initialize-instance (temporarily called *initialize-instance) + reinitialize-instance + update-instance-for-different-class + update-instance-for-redefined-class + shared-initialize + +In this release, these functions accept the specified number of +arguments, return the specified values, have the specified effects, and +are called by the rest of PCL in the specified way at the specified +times (with the exception that PCL does not yet call *make-instance to +create its own metaobjects). Because PCL now checks for unbound slots, +you may notice a slight performance degradation in certain applications. + +For complete information, you should of course see the CLOS specification. +The rest of this note is a short summary of how this new behavior is +different from the last release. + +- Dynamic slots are no longer supported. Various functions like + slot-value-always and remove-slot no longer exist. Also, + slot-value-using-class now only accepts the three arguments as + described in the spec. The two extra arguments having to do with + dynamic slots are no longer accepted. + + Shortly, we will release a metaclass which provides the now missing + dynamic slot behavior. + +- slot-missing now receives and accepts different arguments. + +- slot-unbound is now implemented, and is called at the appropriate + times. + +- the initialization protocol specified in 88-002R is now almost + completely implemented. The only difference is that the current + implementation does not currently check the validity of initargs. + So, no errors are signalled in improper initargs are supplied. + + Because of name conflicts with the two other initialization protocols + PCL currently supports, some of the specified initialization functions + do not have their proper name. The mapping between names in the + specification and names in this version of PCL is as follows: + + SPECIFIED IN PCL + + make-instance *make-instance + initialize-instance *initialize-instance + reinitialize-instance <has proper name> + update-instance-for-different-class <has proper name> + update-instance-for-redefined-class <has proper name> + shared-initialize <has proper name> + + + In a future release of PCL, these functions will have their proper + names, and all the old, obsolete initialization protocols will + disappear. + + Convert to using this new wonderful initialization protocol soon. + + Sometime soon we will release a version of PCL which does significant + optimization of calls to make-instance. This should speed up instance + creation dramatically, which should significantly improve the + performance of some programs. + +- The function all-slots no longer exists. There is a new generic + function called slots-to-inspect, which controls the default behavior + of describe. It also controls the default behavior of the inspector + in ports which have connected their inspectors to PCL. It specifies + which slots of a given class should be inspected. See the definition + in the file high.lisp for more. + +- the metaclass obsolete-class no longer exists. The mechanism by which + instances are marked as being obsolete is now internal, as described + in the spec. The generic-function make-instances-obsolete can be used + to force the instances of a class to go through the obsolete instance + update protocol (see update-instance-for-redefined-class). + +- all-std-class-readers-miss-1, a generic function which was part of + the database interface code I sent out a few weeks ago, has a slightly + different argument list. People using the code I sent out a few weeks + ago should replace the definition there with: + + (defmethod all-std-class-readers-miss-1 + ((class db-class) wrapper slot-name) + (declare (ignore wrapper slot-name)) + ()) + +- The implementation of the slot access generic functions have been + considerably streamlined. The impenetrable macrology which used to be + used is now gone. + +- Because the behavior of the underlying slot access generic functions + has changed, it is possible that some user code which hacks the + underlying instance structure may break. Most of this code shouldn't + break though. There have been some questions on the mailing list + about what is the right way to modify the structure of an instance. + I am working on that section of chapter 3 right now, and will answer + those questions sometime soon. + + +*** Changes to SETF generic functions *** + +This release of PCL includes a significant change related to the order +of arguments of setf generic functions. To most user programs, this +change should be invisible. Your program should run just fine in the +new version of PCL. Even so, there is some conversion you should do to +your program, since DEFMETHOD-SETF is now obsolete and will be going +away soon. + +Some programs may take some work to adapt to this change. This will +be particularly true of programs which manipulated methods for setf +generic-functions using make-instance, add-method and friends. + +Included here is a brief overview of this change to PCL. Most people +will find that this is all they need to know about this change. + +The CLOS specification assumes a default behavior for SETF in the +absence of any defsetf or define-modify-macro. The default behavior is +to expand forms like: + + (SETF (FOO x y) a) + +into: + + (FUNCALL #'(SETF FOO) a x y) + +The key point is that by default, setf expands into a call to a function +with a well-defined name, and that in that call, the new value argument +comes before all the other arguments. + +This requires a change in PCL, because previously, PCL arranged for the +new-value argument to be the last required argument. This change +affects the way automatically generated writer methods work, and the way +that defmethod with a first argument of the form (SETF <symbol>) works. + +An important point is that I cannot implement function names of the form +(SETF <symbol>) portably in PCL. As a result, in PCL, I am using names +of the form |SETF FOO|. Note that the symbol |SETF FOO| is interned in +the home package of the symbol FOO. (See the description of the +GET-SETF-FUNCTION and GET-SETF-FUNCTION-NAME). + + +The user-visible changes are: + +- DEFMETHOD will accept lists of the form (SETF FOO) as a first + argument. This will define methods on the generic function named + by the symbol |SETF FOO|. As specified in the spec, these methods + should expect to receive the new-value as their first argument. + Calls to defmethod of this form will also arrange for SETF of FOO to + expand into an appropriate call to |SETF FOO|. + +- Automatically generated writer methods will expect to receive the new + value as their first argument. + +- DEFMETHOD-SETF will also place the new-value as the first argument. + This is for backward compatibility, since defmethod-setf itself will + be obsolete, and you should convert your code to stop using it. + +- GET-SETF-FUNCTION is a function which takes a function name and + returns the setf function for that function if there is one. Note + that it doesn't take an environment argument. Note that this function + is not specified in Common Lisp or CLOS. PCL will continue to support + it as an extra export indefinetely. + +- GET-SETF-FUNCTION-NAME is a function which takes a function name + and returns the symbol which names the setf function for that + function. Note that this function is not specified in Common Lisp + or CLOS. PCL will continue to support it as an extra export + indefinetely. + +- For convenience, PCL defines a macro called DO-STANDARD-DEFSETF which + can be used to do the appropriate defsetf. This may be helpful for + programs which have calls to setf of a generic-function before any + of the generic function's method definitions. A use of this macro + looks like: + + (do-standard-defsetf position-x) + + Afterwards, a form like (SETF (POSITION-X P) V) will expand into a + form like (|SETF POSITION-X| V P). + + The reason you may have to use do-standard-defsetf is that I cannot + portably change every implementations SETF to have the new default + behavior. The proper way to use this is to take an early file in + your system, and put a bunch of calls to do-standard-defsetf in it. + Note that as soon as PCL sees a defmethod with a name argument of + the form (SETF FOO), or it sees a :accessor in a defclass, it will + do an appropriate do-standard-defsetf for you. + + +In summary, the only things that will need to be changed in most +programs is that uses of defmethod-setf should be converted to +appropriate uses of defmethod. + +Here is an example of a typical user program which is affected by this +change. + +(defclass position () + ((x :initform 0 :accessor pos-x) + (y :initform 0 :accessor pos-y))) + +(defclass monitored-position (position) + ()) + +(defmethod-setf pos-x :before ((p monitored-position)) (new) + (format *trace-output* "~&Changing x coord of ~S to ~D." p new)) + +(defmethod-setf pos-y :before ((p monitored-position)) (new) + (format *trace-output* "~&Changing y coord of ~S to ~D." p new)) + + +To bring this program up to date, you should convert the two +defmethod-setf forms as follows: + +(defmethod (setf pos-x) :before (new (p monitored-position)) + (format *trace-output* "~&Changing x coord of ~S to ~D." p new)) + +(defmethod (setf pos-y) :before (new (p monitored-position)) + (format *trace-output* "~&Changing y coord of ~S to ~D." p new)) + + +*** Other changes in this release *** + +* The symbols exported by the PCL package have now changed. The PCL +package now exports the symbols listed in the table of contents of +chapter 2 of the spec. This list of symbols is the value of the +variable pcl::*exports*. + +Following is the list of symbols which were exported in the 8/2/88 +version but which are not exported in the 8/18/88 version. + +DEFMETHOD-SETF DEFGENERIC-OPTIONS DEFGENERIC-OPTIONS-SETF +CLASS-CHANGED CLASS-NAMED SYMBOL-CLASS +CBOUNDP GET-METHOD GET-SETF-GENERIC-FUNCTION +MAKE-METHOD-CALL + +Following is the list of symbols which are exported in the 8/18/88 +version, but which were not exported in previous versions: + +CALL-METHOD CLASS-NAME COMPUTE-APPLICABLE-METHODS +DEFGENERIC ENSURE-GENERIC-FUNCTION FIND-METHOD +FUNCTION-KEYWORDS GENERIC-FLET GENERIC-LABELS +INITIALIZE-INSTANCE MAKE-INSTANCES-OBSOLETE NO-APPLICABLE-METHOD +NO-NEXT-METHOD REINITIALIZE-INSTANCE SHARED-INITIALIZE +SLOT-BOUNDP SLOT-EXISTS-P SLOT-MAKUNBOUND +SLOT-MISSING SLOT-UNBOUND SYMBOL-MACROLET +UPDATE-INSTANCE-FOR-DIFFERENT-CLASS +UPDATE-INSTANCE-FOR-REDEFINED-CLASS +WITH-ADDED-METHODS + +It should be noted that not all of these newly exported symbols have +been "implemented" yet. + + +* Any program written using PCL will need to be completely recompiled +to run with this release of PCL. + +* The generic-function generic-function-pretty-arglist now returns a +nice arglist for any generic function. It combines all the keyword +arguments accepted by the methods to get the combined set of keywords. +In some ports, the environment specific ARGLIST function has been +connected to this, and so the environments will print out nice arglists +for generic functions. + +* Some bugs in trace-method have been fixed. Trace-method should now +work in all ports of PCL. + +* NO-MATCHING-METHOD has been renamed to NO-APPLICABLE-METHOD. In +addition, it now receives arguments as specified. + +* defmethod has been modified to allow macros which expand into +declarations. + +* The :documentation slot option is now accepted in defclass forms. The +documentation string put here cannot yet be retrieved using the +documentation function. That will happen in a later release. + +* The :writer slot option is now implemented. + +* Some brain damage in high.lisp which caused method lookup to work +incorrectly for built in classes. In addition, it caused the +class-local-supers and class-direct-subclasses of the built in classes +to be strange. People using CLOS browsers should notice this change +dramatically, as it will make the browse of the built in part of the +class lattice look right. + + +*** Older Changes *** + +Following are changes which appeared in release of PCL from 7/7/88 to +8/2/88. Each change is marked with the release it appeared in. + + + +8/2/88 +Loading defclass forms should be much faster now. The bug which caused +all the generic functions in the world to be invalidated whenever a +class was defined has now been fixed. + +Loading defmethod forms should also be much faster. A bug which caused +a tremendous amount of needles computation whenever a method was also +fixed. + + + +8/2/88 +A bug which caused several slots of the classes T, OBJECT, CLASS and +STANDARD-CLASS to be unbound has been fixed. + + + +8/1/88 +load-pcl now adds the symbols :PCL and :PORTABLE-COMMONLOOPS to +*features*. + +PCL still doesn't do any sort of call to PROVIDE because of the total +lack of uniformity in the behavior of require and provide in the various +common lisp implementations. + + +8/1/88 +This version of PCL finally fixes the horrible bug that prevented +the initform for :class allocation slots from being evaluated when the +class was defined. + + +7/20/88 +PCL now converts the function describe into a generic function of one +argument. This is to bring it into conformance with the spec as +described in 88-002. + +In Symbolics Genera, it is actually a function of one required and one +optional argument. This is because the 3600 sometimes calls describe +with more than one argument. + +In Lucid Lisp, describe only takes an optional argument. This argument +defaults to the value of *. PCL converts describe to a generic function +of one required argument so it is not possible to call describe with +only one argument. + + +7/7/88 +class-named and symbol-class have been replaced by find-class. +find-class is documented in 88-002R. + + +7/7/88 +with-slots and with-accessors now conform to 88-002R. + +The old definition of with-slots is now called obsolete-with-slots. The +same is true for with-accessors. + + with-slots ---> obsolete-with-slots + with-accessors --> obsolete-with-accessors + +The temporary correct definition of with-slots, with-slots* is now +called with-slots. The same is true for with-accessors*. + + with-slots* --> with-slots + with-accessors* -> with-accessors + + +7/7/88 +The class-precedence list of the class null now conforms to 88-002R. + +In previous releases of PCL, the class precedence-list of the class +null was: (null list symbol sequence t). In this release the class +precedence list of the class null is: (null symbol list sequence t). + +This change was made to bring PCL into conformance with the spec. + + + +7/7/88 + +print-object now takes only two arguments. + +This changes was made to begin bringing print-object in conformance with +88-002R. print-object conforms to the spec to the extent that is is +called at the approrpiate times for PCL instances. In most +implementations, it is not called at the appropriate times for other +instances. This is not under my control, encourage your vendor to +provide the proper support for print-object. + + +7/7/88 +This version of PCL now includes a beta test version of a new iteration +package. This iteration package was designed by Pavel Curtis and +implemented by Bill vanMelle. This iteration package is defined in the +file iterate.lisp. Please feel free to experiment with it. We are all +very interested in comments on its use. + + + +*** PCL Features that will be disappearing *** + +This section describes features in PCL that will be disappearing in +future releases. For each change, I try to give a release date after +which I will feel free to remove this feature. This list should not be +considered complete. Certain other PCL features will disappear as well. +The items on this list are the user-interface level items that it is +possible to give a lot of warning about. Other changes will have more +subtle effects, for example when the lambda-list congruence rules are +implemented. + +- :accessor-prefix in defclass + +Can disappear anytime after 8/29. + +Warning that this is obsolete has been out for some time. You should +use :accessor in each of the slot specifications of the defclass form. +It is true that this is slightly more cumbersome, but the semantic +difficulties associated with :accesor-prefix are even worse. + +- :constructor in defclass + +Can disappear anytime after 8/29. + +Warning that this is obsolete has been out for some time. It will be +disappearing shortly because the intialization protocol which it goes +with will be disappearing. A future release of PCL will support a +special mechanism for defining functions of the form: + +(defun make-foo (x y &optional z) + (make-instance 'foo 'x x :y y :z z)) + +In the case where there are only :after methods on initialize-instance +and shared-initialize, these functions will run like the wind. We hope +to release this facility by 9/15. + +- old definition of make-instance, intialize, initialize-from-defaults, + initialize-from-init-plist + +Can disappear anytime after 8/29. + +Convert to using the new initialization protocol as described in the +spec and above. + +- mki, old definition of initialize-instance + +Can disappear anytime after 8/29. + +Convert to using the new initialization protocol as described in the +spec and above. + +- defmethod-setf + +Can disappear anytime after 9/15. + +Convert to using (defmethod (setf foo) ... + + diff --git a/pcl/cloe-low.lisp b/pcl/cloe-low.lisp new file mode 100644 index 000000000..a58e00085 --- /dev/null +++ b/pcl/cloe-low.lisp @@ -0,0 +1,32 @@ +;;;-*-Mode:LISP; Package: PCL; Base:10; Syntax:Common-lisp -*- +;;; +;;; ************************************************************************* +;;; Copyright (c) 1985, 1986, 1987, 1988 Xerox Corporation. +;;; All rights reserved. +;;; +;;; Use and copying of this software and preparation of derivative works +;;; based upon this software are permitted. Any distribution of this +;;; software or derivative works must comply with all applicable United +;;; States export control laws. +;;; +;;; This software is made available AS IS, and Xerox Corporation makes no +;;; warranty about the software, its performance or its conformity to any +;;; specification. +;;; +;;; Any person obtaining a copy of this software is requested to send their +;;; name and post office or electronic mail address to: +;;; CommonLoops Coordinator +;;; Xerox PARC +;;; 3333 Coyote Hill Rd. +;;; Palo Alto, CA 94304 +;;; (or send Arpanet mail to CommonLoops-Coordinator.pa@Xerox.arpa) +;;; +;;; Suggestions, comments and requests for improvements are also welcome. +;;; ************************************************************************* +;;; + +(in-package 'pcl) + +(defmacro object-cache-no (object mask) + `(logand (sys::address-of ,object) ,mask)) + diff --git a/pcl/kcl-notes.text b/pcl/kcl-notes.text new file mode 100644 index 000000000..9628c2370 --- /dev/null +++ b/pcl/kcl-notes.text @@ -0,0 +1,38 @@ + +Some notes on using "5/1/90 May Day PCL (REV 3)" with KCL and AKCL. + +1. KCL will try to load the PCL file "init" when it starts up, + if you rename the files as is mentioned in defsys.lisp and the + currect directory is the one containing PCL. I suggest that + you do not rename any file except maybe "defsys", and also + that you change the (files-renamed-p t) to (files-renamed-p nil) + in defsys.lisp. + +2. Do not comment out the file kcl-patches.lisp, even if you are + using AKCL. It contins a patch to make compiler messages more + informative for AKCL, and also sets compiler::*compile-ordinaries* + to T, so that methods will get compiled. + +3. While fixup.lisp compiles, there will be a pause, because + KCL's compiler is not reentrant, and some uncompiled + code is run. If you want, you can change the form + (fix-early-generic-functions) to (fix-early-generic-functions t) + in fixup.lisp to see what is happening. + +4. If you want, you can apply the changes in kcl-mods.text + to your KCL or AKCL to make PCL run faster. The file kcl-mods.text + is different from what it was in versions of PCL earlier than + May Day PCL. If you do not make these changes, or if you made + the old changes, things will still work. + +5. If you are using AKCL, and you previously used the kcl-low.lisp + file from rascal.ics.utexas.edu, you should not use it this time. + The kcl-low.lisp that comes with May Day PCL works fine. (If you + insist on using an old version of kcl-low.lisp, you will need to + use an old version of the KCL part of fin.lisp as well: this is + what is done for IBCL, by the way.) + +6. I recommend that you use AKCL version 457 or newer rather than using + KCL or an older version of AKCL, because there are some bugs in KCL + that cause problems for May Day PCL. + diff --git a/pcl/notes.text b/pcl/notes.text new file mode 100644 index 000000000..3e2175e24 --- /dev/null +++ b/pcl/notes.text @@ -0,0 +1,98 @@ +Copyright (c) Xerox Corporation 1989, 1990. All rights reserved. + +These notes correspond to the "5/1/90 May Day PCL (REV 2)" version of PCL. + +This version is just Rainy Day PCL with the various patches people have +mailed out included. Barring unforseen circumstances, this will be the +last version of PCL. We are now working on the Metaobject Protocol. + + +Please read this entire file carefully. Failure to do so guarantees +that you will have problems porting your code from the previous release +of PCL. + +You may also be interested in looking at previous versions of the +notes.text file. These are called xxx-notes.text where xxx is the +version of the PCL system the file corresponds to. At least the last +two versions of this file contain useful information for any PCL user. + +This version of PCL has been tested at PARC in the following Common +Lisps: + + Symbolics 7.2, 7.4 + Coral 1.3 + Lucid 3.0 + Allegro 3.0.1 + +These should work, but haven't been tested yet: + + TI + Golden Common Lisp 3.1 + EnvOS Medley + IBCL (October 15, 1987) + +This release of PCL is substantially different from previous releases. +The architecture of the runtime system (method lookup and slot access) +is different, and the metaobject protocol is different. Much of the +code in this release is new or modified from the last release. + +When it stabilizes, this release should be much faster for all +applications especially large ones. + +This beta version of the new release includes a number of known +problems. These include: + +* Even less documentation than ever before. I haven't written much of a +notes file for what is different yet. Please send me comments for what +to include in this file. + +* Some known performance problems in development versions of compilers. +At the very least, you want to compile PCL itself using the highest +performance compiler settings you have. + + +=== Notes for this release (such as they are) === + +* There is one major incompatible change in this release. In this +release compiling files with defmethod and defclass forms doesn't, by +default, affect the running lisp image. The winning part of this is you +can compile a file without `installing' the class and method definitions +in the file. The losing part is that because PCL is a portable program, +it can't both do this and let a class definition and a method which +specializes to that class appear in the same file. + +So, you can't (by default) have: + + (defclass foo () ()) + (defmethod bar ((f foo)) 'foo) + +in the same file. + +But you say you want to do this, almost everyone does. If you want to +do this just evaluate the following form before after loading PCL but +before working with it: + + (pushnew 'compile pcl::*defclass-times*) + +You may also want to do: + + (pushnew 'compile pcl::*defmethod-times*) + + +* You probably also want to begin using a precom file for your system. +Do this by having a file whose only contents is + + (pcl::precompile-random-code-segments <your-system-name>) + +don't quote <your-system-name> + +for example, for the clim system, the precom file has the one line: + + (pcl::precompile-random-code-segments clim) + +compile this file after loading and running your system for a while. +load it before loading your compiled system. A future version of this +feature won't require you to have run your system for a while, it will +only require that you have loaded it. + + diff --git a/pcl/rel-8-patches.lisp b/pcl/rel-8-patches.lisp new file mode 100644 index 000000000..99b85b25e --- /dev/null +++ b/pcl/rel-8-patches.lisp @@ -0,0 +1,255 @@ +;;; -*- Mode: LISP; Syntax: Common-lisp; Package: ZL-USER; Base: 10; Patch-File: T -*- + +;===================================== +(SYSTEM-INTERNALS:BEGIN-PATCH-SECTION) +(SYSTEM-INTERNALS:PATCH-SECTION-SOURCE-FILE "SYS:l-COMPILER;OPTIMIZE.LISP.179") +(SYSTEM-INTERNALS:PATCH-SECTION-ATTRIBUTES + "-*- Mode: Lisp; Package: Compiler; Lowercase: T; Base: 8 -*-") + +;;; Does simple constant folding. This works for everything that doesn't have +;;; side-effects. +;;; ALL operands must be constant. +;;; Note that commutative-constant-folder can hack this case perfectly well +;;; by himself for the functions he handles. +(defun constant-fold-optimizer (form) + (let ((eval-when-load-p nil)) + (flet ((constant-form-p (x) + (when (constant-form-p x) + (cond ((and (listp x) + (eq (car x) 'quote) + (listp (cadr x)) + (eq (caadr x) eval-at-load-time-marker)) + (setq eval-when-load-p t) + (cdadr x)) + (t x))))) + (if (every (cdr form) #'constant-form-p) + (if eval-when-load-p + (list 'quote + (list* eval-at-load-time-marker + (car form) + (mapcar #'constant-form-p (cdr form)))) + (condition-case (error-object) + (multiple-value-call #'(lambda (&rest values) + (if (= (length values) 1) + `',(first values) + `(values ,@(mapcar #'(lambda (x) `',x) + values)))) + (eval form)) + (error + (phase-1-warning "Constant form left unoptimized: ~S~%because: ~~A~" + form error-object) + form))) + form)))) + + +;===================================== +(SYSTEM-INTERNALS:BEGIN-PATCH-SECTION) +(SYSTEM-INTERNALS:PATCH-SECTION-SOURCE-FILE "SYS:L-COMPILER;COMFILE.LISP.85") +(SYSTEM-INTERNALS:PATCH-SECTION-ATTRIBUTES + "-*- Mode: Lisp; Package: Compiler; Lowercase: T; Base: 8 -*-") + +;;; +;;; The damn compiler doesn't compile random forms that appear at top level. +;;; Its difficult to do because you have to get an associated function spec +;;; to go with those forms. This handles that by defining a special form, +;;; top-level-form that compiles its body. It takes a list of eval-when +;;; times just like eval when does. It also takes a name which it uses +;;; to construct a function spec for the top-level-form function it has +;;; to create. +;;; +; +;si:: +;(defvar *top-level-form-fdefinitions* (cl:make-hash-table :test #'equal)) +; +;si:: +;(define-function-spec-handler pcl::top-level-form +; (operation fspec &optional arg1 arg2) +; (let ((name (cadr fspec))) +; (selectq operation +; (validate-function-spec (and (= (length fspec) 2) +; (or (symbolp name) +; (listp name)))) +; (fdefine +; (setf (gethash name *top-level-form-fdefinitions*) arg1)) +; ((fdefinition fdefinedp) +; (gethash name *top-level-form-fdefinitions*)) +; (fdefinition-location +; (ferror "It is not possible to get the fdefinition-location of ~s." +; fspec)) +; (fundefine (remhash name *top-level-form-fdefinitions*)) +; (otherwise (function-spec-default-handler operation fspec arg1 arg2))))) +; +;;; +;;; This is basically stolen from PROGN (surprised?) +;;; +;(si:define-special-form pcl::top-level-form (name times +; &body body +; &environment env) +; (declare lt:(arg-template . body) (ignore name)) +; (si:check-eval-when-times times) +; (when (member 'eval times) (si:eval-body body env))) +; +;(defun (:property pcl::top-level-form lt:mapforms) (original-form form usage) +; (lt::mapforms-list original-form form (cddr form) 'eval usage)) + +;;; This is the normal function for looking at each form read from the file and calling +;;; *COMPILE-FORM-FUNCTION* on the sub-forms of it. +;;; COMPILE-TIME-TOO means override the normal cases that eval at compile time. It is +;;; used for recursive calls under (EVAL-WHEN (COMPILE LOAD) ...). +;(DEFUN COMPILE-FROM-STREAM-1 (FORM &OPTIONAL (COMPILE-TIME-TOO NIL)) +; (CATCH-ERROR-RESTART +; (SYS:ERROR "Skip compiling form ~2,2\COMPILER:SHORT-S-FORMAT\" FORM) +; (LET ((DEFAULT-CONS-AREA (FUNCALL *COMPILE-FUNCTION* ':CONS-AREA))) +; (LET ((ERROR-MESSAGE-HOOK +; #'(LAMBDA () +; (DECLARE (SYS:DOWNWARD-FUNCTION)) +; (FORMAT T "~&While processing ~V,V\COMPILER:SHORT-S-FORMAT\" +; DBG:*ERROR-MESSAGE-PRINLEVEL* +; DBG:*ERROR-MESSAGE-PRINLENGTH* +; FORM)))) +; (SETQ FORM (FUNCALL *COMPILE-FUNCTION* ':MACRO-EXPAND FORM))) +; (WHEN (LISTP FORM) ;Ignore atoms at top-level +; (LET ((FUNCTION (FIRST FORM))) +; (SELECTQ FUNCTION +; ((QUOTE)) ;and quoted constants e.g. 'COMPILE +; ((PROGN) +; (DOLIST (FORM (CDR FORM)) +; (COMPILE-FROM-STREAM-1 FORM COMPILE-TIME-TOO))) +; ((EVAL-WHEN) +; (SI:CHECK-EVAL-WHEN-TIMES (CADR FORM)) +; (LET ((COMPILE-P (OR (MEMQ 'COMPILE (CADR FORM)) +; (AND COMPILE-TIME-TOO (MEMQ 'EVAL (CADR FORM))))) +; (LOAD-P (OR (MEMQ 'LOAD (CADR FORM)) (MEMQ 'CL:LOAD (CADR FORM)))) +; (FORMS (CDDR FORM))) +; (COND (LOAD-P +; (DOLIST (FORM FORMS) +; (COMPILE-FROM-STREAM-1 FORM (AND COMPILE-P ':FORCE)))) +; (COMPILE-P +; (DOLIST (FORM FORMS) +; (FUNCALL *COMPILE-FORM-FUNCTION* FORM ':FORCE NIL)))))) +; ((DEFUN) +; (LET ((TEM (DEFUN-COMPATIBILITY (CDR FORM) :WARN-IF-OBSOLETE T))) +; (IF (EQ (CDR TEM) (CDR FORM)) +; (FUNCALL *COMPILE-FORM-FUNCTION* FORM COMPILE-TIME-TOO T) +; (COMPILE-FROM-STREAM-1 TEM COMPILE-TIME-TOO)))) +; ((MACRO) +; (FUNCALL *COMPILE-FORM-FUNCTION* FORM (OR COMPILE-TIME-TOO T) T)) +; ((DECLARE) +; (DOLIST (FORM (CDR FORM)) +; (FUNCALL *COMPILE-FORM-FUNCTION* FORM (OR COMPILE-TIME-TOO T) +; ;; (DECLARE (SPECIAL ... has load-time action as well. +; ;; All other DECLARE's do not. +; (MEMQ (CAR FORM) '(SPECIAL ZL:UNSPECIAL))))) +; ((COMPILER-LET) +; (COMPILER-LET-INTERNAL (CADR FORM) (CDDR FORM) +; #'COMPILE-FROM-STREAM-1 COMPILE-TIME-TOO)) +; ((SI:DEFINE-SPECIAL-FORM) +; (FUNCALL *COMPILE-FORM-FUNCTION* FORM COMPILE-TIME-TOO T)) +; ((MULTIPLE-DEFINITION) +; (DESTRUCTURING-BIND (NAME TYPE . BODY) (CDR FORM) +; (LET ((NAME-VALID (AND (NOT (NULL NAME)) +; (OR (SYMBOLP NAME) +; (AND (LISTP NAME) (NEQ (CAR NAME) 'QUOTE))))) +; (TYPE-VALID (AND (NOT (NULL TYPE)) (SYMBOLP TYPE)))) +; (UNLESS (AND NAME-VALID TYPE-VALID) +; (WARN "(~S ~S ~S ...) is invalid because~@ +; ~:[~S is not valid as a definition name~;~*~]~ +; ~:[~&~S is not valid as a definition type~;~*~]" +; 'MULTIPLE-DEFINITION NAME TYPE NAME-VALID NAME TYPE-VALID TYPE))) +; (LET* ((COMPILED-BODY NIL) +; (COMPILE-FUNCTION *COMPILE-FUNCTION*) +; (*COMPILE-FUNCTION* +; (LAMBDA (OPERATION &REST ARGS) +; (DECLARE (SYS:DOWNWARD-FUNCTION)) +; (SELECTQ OPERATION +; (:DUMP-FORM +; (PUSH (FUNCALL COMPILE-FUNCTION :OPTIMIZE-TOP-LEVEL-FORM +; (FIRST ARGS)) +; COMPILED-BODY)) +; (:INSTALL-DEFINITION +; (PUSH (FORM-FOR-DEFINE *COMPILER* (FIRST ARGS) (SECOND ARGS)) +; COMPILED-BODY)) +; (OTHERWISE (CL:APPLY COMPILE-FUNCTION OPERATION ARGS))))) +; (LOCAL-DECLARATIONS `((FUNCTION-PARENT ,NAME ,TYPE) +; ,@LOCAL-DECLARATIONS))) +; (DOLIST (FORM BODY) +; (COMPILE-FROM-STREAM-1 FORM COMPILE-TIME-TOO)) +; (FUNCALL COMPILE-FUNCTION :DUMP-FORM +; `(LOAD-MULTIPLE-DEFINITION +; ',NAME ',TYPE ',(NREVERSE COMPILED-BODY) NIL))))) +; ((pcl::top-level-form) +; (destructuring-bind (name times . body) +; (cdr form) +; (si:check-eval-when-times times) +; (let ((compile-p (or (memq 'compile times) +; (and compile-time-too (memq 'eval times)))) +; (load-p (or (memq 'load times) +; (memq 'cl:load times))) +; (fspec `(pcl::top-level-form ,name))) +; (cond (load-p +; (compile-from-stream-1 +; `(progn (defun ,fspec () . ,body) +; (funcall (function ,fspec))) +; (and compile-p ':force))) +; (compile-p +; (dolist (b body) +; (funcall *compile-form-function* form ':force nil))))))) +; (OTHERWISE +; (LET ((TEM (AND (SYMBOLP FUNCTION) (GET FUNCTION 'TOP-LEVEL-FORM)))) +; (IF TEM +; (FUNCALL *COMPILE-FORM-FUNCTION* (FUNCALL TEM FORM) COMPILE-TIME-TOO T) +; (FUNCALL *COMPILE-FORM-FUNCTION* FORM COMPILE-TIME-TOO T)))))))))) +; +; + + +dw:: +(defun symbol-flavor-or-cl-type (symbol) + (declare (values flavor defstruct-p deftype-fun typep-fun atomic-subtype-parent + non-atomic-deftype)) + (multiple-value-bind (result foundp) + (gethash symbol *flavor-or-cl-type-cache*) + (let ((frob + (if foundp result + (setf (gethash symbol *flavor-or-cl-type-cache*) + (or (get symbol 'flavor:flavor) + (let ((class (get symbol 'clos-internals::class-for-name))) + (when (and class + (not (typep class 'clos:built-in-class))) + class)) + (not (null (defstruct-type-p symbol))) + (let* ((deftype (get symbol 'deftype)) + (descriptor (symbol-presentation-type-descriptor symbol)) + (typep + (unless (and descriptor + (presentation-type-explicit-type-function + descriptor)) + ;; Don't override the one defined in the presentation-type. + (get symbol 'typep))) + (atomic-subtype-parent (find-atomic-subtype-parent symbol)) + (non-atomic-deftype + (when (and (not descriptor) deftype) + (not (member (first (type-arglist symbol)) + '(&rest &key &optional)))))) + (if (or typep (not (atom deftype)) + non-atomic-deftype + ;; deftype overrides atomic-subtype-parent. + (and (not deftype) atomic-subtype-parent)) + (list-in-area *handler-dynamic-area* + deftype typep atomic-subtype-parent + non-atomic-deftype) + deftype))))))) + (locally (declare (inline compiled-function-p)) + (etypecase frob + (array (values frob)) + (instance (values frob)) + (null (values nil)) + ((member t) (values nil t)) + (compiled-function (values nil nil frob)) + (lexical-closure (values nil nil frob)) + (list (destructuring-bind (deftype typep atomic-subtype-parent non-atomic-deftype) + frob + (values nil nil deftype typep atomic-subtype-parent non-atomic-deftype))) + (symbol (values nil nil nil nil frob))))))) + + diff --git a/pcl/sysdef.lisp b/pcl/sysdef.lisp new file mode 100644 index 000000000..1249291b5 --- /dev/null +++ b/pcl/sysdef.lisp @@ -0,0 +1,102 @@ +;;; -*- Mode: Lisp; Base: 10; Syntax: Common-Lisp; Package: DSYS -*- +;;; File: sysdef.lisp +;;; Author: Richard Harris +;;; +;;; ROSE - Rensselaer Object System for Engineering +;;; Common Lisp Implementation +;;; +;;; Copyright (c) 1990 by +;;; Rensselaer Polytechnic Institute, Troy, New York. +;;; All Rights Reserved +;;; +;;; THE SOFTWARE AND ACCOMPANYING WRITTEN MATERIALS ARE PROVIDED +;;; \"AS IS\" AND WITHOUT ANY WARRANTY, INCLUDING BUT NOT LIMITED +;;; TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +;;; A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND +;;; PERFORMANCE OF THE SOFTWARE AND USE OF THE ACCOMPANYING WRITTEN +;;; MATERIALS IS ASSUMED BY YOU. IN NO EVENT SHALL RENSSELAER +;;; POLYTECHNIC INSTITUTE BE LIABLE FOR ANY LOST REVENUE, LOST +;;; PROFITS OR OTHER INCIDENTAL OR CONSEQUENTIAL DAMAGES, EVEN +;;; IF ADVISED OF THE POSSIBILITIES OF SUCH DAMAGES, WHERE DAMAGES +;;; ARISE OUT OF OR IN CONNECTION WITH THE USE OF, PERFORMANCE OR +;;; NONPERFORMANCE OF THIS SOFTWARE. +;;; +;;; This software and accompanying written materials may not be +;;; distributed outside your organization or outside the United +;;; States of America without express written authorization from +;;; Rensselaer Polytechnic Institute. +;;; +;;; This work has been sponsored in part by Defense Advanced Research +;;; Projects Agency (DARPA) under contract number MDA972-88-C0047 for +;;; DARPA Initiative in Concurrent Engineering (DICE). This material +;;; may be reproduced by or for the U.S. Government pursuant to the +;;; copyright license under the clause at DFARS 252.227-7013 7/26/90. +;;; + +(in-package "DSYS") + +(defvar *pcl-compiled-p* nil) +(defvar *pcl-loaded-p* nil) + +(defsystem pcl + (:pretty-name "PCL") + (:forms + :compile + (let ((defsys (subfile '("pcl") :name "defsys"))) + (unless *pcl-compiled-p* + (let ((*skip-load-if-loaded-p* t) + (*skip-compile-file-fwd* 0)) + (set (intern (symbol-name ':*pcl-directory*) + (or (find-package :pcl) + (make-package :pcl :use '(:lisp)))) + defsys) + (compile-file defsys) + (load-file defsys)) + (funcall (intern "COMPILE-PCL" "PCL")) + (setq *pcl-compiled-p* t) + (let ((b-s (find-symbol "*BOOT-STATE*" "PCL")) + (*skip-load-if-loaded-p* nil)) + (when (and b-s (boundp b-s) (symbol-value b-s)) + #+genera (scl:pkg-kill "PCL") + #+lucid (lcl:delete-package "PCL") + #-(or genera lucid) (rename-package "PCL" (symbol-name (gensym))) + (set (intern (symbol-name ':*pcl-directory*) + (or (find-package :pcl) + (make-package :pcl :use '(:lisp)))) + defsys) + (load-file defsys)) + (funcall (intern "LOAD-PCL" "PCL"))) + (setq *pcl-loaded-p* t))) + :load + (unless *pcl-loaded-p* + (let ((defsys (subfile '("pcl") :name "defsys"))) + (let ((*skip-load-if-loaded-p* t)) + (set (intern (symbol-name ':*pcl-directory*) + (or (find-package :pcl) + (make-package :pcl :use '(:lisp)))) + defsys) + (load-file defsys)) + (funcall (intern "LOAD-PCL" "PCL")) + (setq *pcl-loaded-p* t))))) + +(pushnew 'pcl *auto-load-systems*) + +(defparameter *pcl-files* + '((("systems") "lisp" + "pcl") + (("pcl") "lisp" + "sysdef" + "boot" "braid" "cache" "cloe-low" "cmu-low" "combin" "compat" + "construct" "coral-low" "cpatch" "cpl" "ctypes" "defclass" "defcombin" + "defs" "defsys" "dfun" "dlap" "env" "excl-low" "fin" "fixup" "fngen" "fsc" + "gcl-patches" "genera-low" "gold-low" "hp-low" "ibcl-low" "ibcl-patches" + "init" "iterate" "kcl-low" "kcl-patches" "lap" "low" "lucid-low" "macros" + "methods" "pcl-env-internal" "pcl-env" "pkg" "plap" "precom1" "precom2" + "precom4" "pyr-low" "pyr-patches" "quadlap" "rel-7-2-patches" "rel-8-patches" + "slots" "std-class" "ti-low" "ti-patches" "vaxl-low" "vector" "walk" + "xerox-low" "xerox-patches") + (("pcl") "text" + "12-7-88-notes" "3-17-88-notes" "3-19-87-notes" "4-21-87-notes" + "4-29-87-notes" "5-22-87-notes" "5-22-89-notes" "8-28-88-notes" + "get-pcl" "kcl-mods" "kcl-notes" "lap" "notes" "pcl-env" "readme"))) + -- GitLab