From 55160a83570bebab1dba8aa19eb01156bfbf63a4 Mon Sep 17 00:00:00 2001
From: dtc <dtc>
Date: Sun, 14 Dec 1997 13:52:11 +0000
Subject: [PATCH] Compiling the initialisation function for the
 checking-or-caching-function-list in dlisp2.lisp depends on macros in
 boot.lisp and braid.lisp which are not loaded until later. So move this code
 from dlisp2.lisp to a new file dlisp3.lisp so this can be compiled later.
 Leave this init. disabled, although some performance improvements have been
 seen by enabling it.

---
 pcl/defsys.lisp |  2 ++
 pcl/dlisp2.lisp | 50 ++-------------------------------
 pcl/dlisp3.lisp | 74 +++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 78 insertions(+), 48 deletions(-)
 create mode 100644 pcl/dlisp3.lisp

diff --git a/pcl/defsys.lisp b/pcl/defsys.lisp
index c3eb0d135..776455847 100644
--- a/pcl/defsys.lisp
+++ b/pcl/defsys.lisp
@@ -858,6 +858,8 @@ and load your system with:
    (dfun        t                                   t (boot low cache))
    (fast-init   t                                   t (boot low))
    (braid       (+ precom1 precom2)                 t (boot defs low fin cache))
+   #+ignore
+   (dlisp3      t                                   t (dlisp2 boot braid))
    (generic-functions t                             t (boot))
    (slots       t                                   t (vector boot defs low cache fin))
    (init        t                                   t (vector boot defs low fast-init))
diff --git a/pcl/dlisp2.lisp b/pcl/dlisp2.lisp
index dd543b2d8..3d0fc48f1 100644
--- a/pcl/dlisp2.lisp
+++ b/pcl/dlisp2.lisp
@@ -66,56 +66,10 @@
 		      (emit-one-or-n-index-reader/writer-macro :writer nil nil)))))
    nil))
 
-(eval-when (compile load eval)
-(defparameter checking-or-caching-list
-  '()
-  #||
-  '((T NIL (CLASS) NIL)
-    (T NIL (CLASS CLASS) NIL)
-    (T NIL (CLASS CLASS CLASS) NIL)
-    (T NIL (CLASS CLASS T) NIL)
-    (T NIL (CLASS CLASS T T) NIL)
-    (T NIL (CLASS CLASS T T T) NIL)
-    (T NIL (CLASS T) NIL)
-    (T NIL (CLASS T T) NIL)
-    (T NIL (CLASS T T T) NIL)
-    (T NIL (CLASS T T T T) NIL)
-    (T NIL (CLASS T T T T T) NIL)
-    (T NIL (CLASS T T T T T T) NIL)
-    (T NIL (T CLASS) NIL)
-    (T NIL (T CLASS T) NIL)
-    (T NIL (T T CLASS) NIL)
-    (T NIL (CLASS) T)
-    (T NIL (CLASS CLASS) T)
-    (T NIL (CLASS T) T)
-    (T NIL (CLASS T T) T)
-    (T NIL (CLASS T T T) T)
-    (T NIL (T CLASS) T)
-    (T T (CLASS) NIL)
-    (T T (CLASS CLASS) NIL)
-    (T T (CLASS CLASS CLASS) NIL)
-    (NIL NIL (CLASS) NIL)
-    (NIL NIL (CLASS CLASS) NIL)
-    (NIL NIL (CLASS CLASS T) NIL)
-    (NIL NIL (CLASS CLASS T T) NIL)
-    (NIL NIL (CLASS T) NIL)
-    (NIL NIL (T CLASS T) NIL)
-    (NIL NIL (CLASS) T)
-    (NIL NIL (CLASS CLASS) T)) ||# ))
-
-(defmacro make-checking-or-caching-function-list ()
-  `(list ,@(mapcar #'(lambda (key)
-		       `(cons ',key (emit-checking-or-caching-macro ,@key)))
-		   checking-or-caching-list)))
-
+;;; Note this list is setup in dlisp3.lisp when all the necessary
+;;; macros have been loaded.
 (defvar checking-or-caching-function-list)
 
-(defun initialize-checking-or-caching-function-list ()
-  (setq checking-or-caching-function-list
-	(make-checking-or-caching-function-list)))
-
-(initialize-checking-or-caching-function-list)
-
 (defmacro emit-checking-or-caching-function-precompiled ()
   `(cdr (assoc (list cached-emf-p return-value-p metatypes applyp)
 	       checking-or-caching-function-list
diff --git a/pcl/dlisp3.lisp b/pcl/dlisp3.lisp
new file mode 100644
index 000000000..26865a725
--- /dev/null
+++ b/pcl/dlisp3.lisp
@@ -0,0 +1,74 @@
+;;;-*-Mode:LISP; Package:(PCL LISP 1000); Base:10; Syntax:Common-lisp -*-
+;;;
+;;; *************************************************************************
+;;; Copyright (c) 1985, 1986, 1987, 1988, 1989, 1990 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)
+
+(eval-when (compile load eval)
+(defparameter checking-or-caching-list
+  '((T NIL (CLASS) NIL)
+    (T NIL (CLASS CLASS) NIL)
+    (T NIL (CLASS CLASS CLASS) NIL)
+    (T NIL (CLASS CLASS T) NIL)
+    (T NIL (CLASS CLASS T T) NIL)
+    (T NIL (CLASS CLASS T T T) NIL)
+    (T NIL (CLASS T) NIL)
+    (T NIL (CLASS T T) NIL)
+    (T NIL (CLASS T T T) NIL)
+    (T NIL (CLASS T T T T) NIL)
+    (T NIL (CLASS T T T T T) NIL)
+    (T NIL (CLASS T T T T T T) NIL)
+    (T NIL (T CLASS) NIL)
+    (T NIL (T CLASS T) NIL)
+    (T NIL (T T CLASS) NIL)
+    (T NIL (CLASS) T)
+    (T NIL (CLASS CLASS) T)
+    (T NIL (CLASS T) T)
+    (T NIL (CLASS T T) T)
+    (T NIL (CLASS T T T) T)
+    (T NIL (T CLASS) T)
+    (T T (CLASS) NIL)
+    (T T (CLASS CLASS) NIL)
+    (T T (CLASS CLASS CLASS) NIL)
+    (NIL NIL (CLASS) NIL)
+    (NIL NIL (CLASS CLASS) NIL)
+    (NIL NIL (CLASS CLASS T) NIL)
+    (NIL NIL (CLASS CLASS T T) NIL)
+    (NIL NIL (CLASS T) NIL)
+    (NIL NIL (T CLASS T) NIL)
+    (NIL NIL (CLASS) T)
+    (NIL NIL (CLASS CLASS) T))))
+
+(defmacro make-checking-or-caching-function-list ()
+  `(list ,@(mapcar #'(lambda (key)
+		       `(cons ',key (emit-checking-or-caching-macro ,@key)))
+		   checking-or-caching-list)))
+
+(defun initialize-checking-or-caching-function-list ()
+  (setq checking-or-caching-function-list
+	(make-checking-or-caching-function-list)))
+
+(initialize-checking-or-caching-function-list)
-- 
GitLab