From 08395aae2451d5d7ca16e5dcbf660031ddc1ba99 Mon Sep 17 00:00:00 2001
From: pmai <pmai>
Date: Tue, 27 Aug 2002 19:01:40 +0000
Subject: [PATCH] Patch by Gerd Moellmann to turn old-style into new-style
 eval-when's in the PCL code base.

---
 pcl/bench.lisp               |  9 ++-------
 pcl/boot.lisp                |  8 ++++----
 pcl/braid.lisp               |  4 ++--
 pcl/cache.lisp               | 10 +++++-----
 pcl/cmucl-documentation.lisp |  4 ++--
 pcl/defs.lisp                |  4 ++--
 pcl/defsys.lisp              |  4 ++--
 pcl/dlisp3.lisp              |  4 ++--
 pcl/extensions.lisp          |  4 ++--
 pcl/fast-init.lisp           |  4 ++--
 pcl/fin.lisp                 |  4 ++--
 pcl/fsc.lisp                 |  4 ++--
 pcl/gray-streams.lisp        |  4 ++--
 pcl/macros.lisp              |  4 ++--
 pcl/precom1.lisp             |  2 +-
 pcl/user-instances.lisp      |  8 ++++----
 pcl/walk.lisp                |  6 +++---
 17 files changed, 41 insertions(+), 46 deletions(-)

diff --git a/pcl/bench.lisp b/pcl/bench.lisp
index f47165857..bc92fc57b 100644
--- a/pcl/bench.lisp
+++ b/pcl/bench.lisp
@@ -24,12 +24,7 @@
 ;;; jeff morrill
 ;;; jmorrill@bbn.com
 
-#+Genera
-(eval-when (compile load eval)
-  (import '(clos-internals::allocate-instance)))
-
-#+cmu
-(eval-when (compile load eval)
+(eval-when (:compile-toplevel :load-toplevel :execute)
   (import '(pcl:allocate-instance)))
 
 (declaim (optimize (speed 3) (safety 3 #+nil 1) (space 0)
@@ -119,7 +114,7 @@
 (declaim (single-float *speed-of-empty-loop*))
 (defvar *speed-of-empty-loop*)
 
-(eval-when (load eval)
+(eval-when (:load-toplevel :execute)
   (setq *empty-iterations* (compute-empty-iterations))
   (setq *speed-of-empty-loop* (/ (empty-speed *empty-iterations*)
 				 (float *empty-iterations*))))
diff --git a/pcl/boot.lisp b/pcl/boot.lisp
index 0ecdeec39..b6e43b52a 100644
--- a/pcl/boot.lisp
+++ b/pcl/boot.lisp
@@ -26,7 +26,7 @@
 ;;;
 
 (ext:file-comment
- "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/boot.lisp,v 1.30 2002/08/27 18:46:48 pmai Exp $")
+ "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/boot.lisp,v 1.31 2002/08/27 19:01:37 pmai Exp $")
 
 (in-package :pcl)
 
@@ -98,7 +98,7 @@ work during bootstrapping.
 ;;; a separate piece of code because of a bug in ExCL which causes this not
 ;;; to work if it is inlined.
 ;;;
-(eval-when (load eval)
+(eval-when (:load-toplevel :execute)
 
 (defun redirect-early-function-internal (real early)
   (setf (gdefinition real)
@@ -636,7 +636,7 @@ work during bootstrapping.
 
 (declaim (ext:freeze-type fast-instance-boundp))
 
-(eval-when (compile load eval)
+(eval-when (:compile-toplevel :load-toplevel :execute)
 (defvar *allow-emf-call-tracing-p* nil)
 (defvar *enable-emf-call-tracing-p* #-testing nil #+testing t)
 )
@@ -2062,7 +2062,7 @@ work during bootstrapping.
 		     (cons (if (listp arg) (car arg) arg) required)))))))
 
 
-(eval-when (load eval)
+(eval-when (:load-toplevel :execute)
   (setq *boot-state* 'early))
 
 (defmacro with-slots (slots instance &body body)
diff --git a/pcl/braid.lisp b/pcl/braid.lisp
index 45fb7b2d9..c94352e10 100644
--- a/pcl/braid.lisp
+++ b/pcl/braid.lisp
@@ -26,7 +26,7 @@
 ;;;
 
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/braid.lisp,v 1.22 2002/08/26 02:23:11 pmai Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/braid.lisp,v 1.23 2002/08/27 19:01:37 pmai Exp $")
 ;;;
 ;;; Bootstrapping the meta-braid.
 ;;;
@@ -580,7 +580,7 @@
 	(setf (lisp:find-class name) lclass
 	      (lisp:class-name lclass) name)))))
 
-(eval-when (load eval)
+(eval-when (:load-toplevel :execute)
   (clrhash *find-class*)
   (bootstrap-meta-braid)
   (bootstrap-accessor-definitions t)
diff --git a/pcl/cache.lisp b/pcl/cache.lisp
index aa52ab938..a788ea7ea 100644
--- a/pcl/cache.lisp
+++ b/pcl/cache.lisp
@@ -26,7 +26,7 @@
 ;;;
 
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/cache.lisp,v 1.15 2002/08/26 02:23:11 pmai Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/cache.lisp,v 1.16 2002/08/27 19:01:37 pmai Exp $")
 ;;;
 ;;; The basics of the PCL wrapper cache mechanism.
 ;;;
@@ -125,7 +125,7 @@
   '(integer 0    ;#.(position 'number wrapper-layout)
             7))  ;#.(position 'number wrapper-layout :from-end t)
 
-(eval-when (compile load eval)
+(eval-when (:compile-toplevel :load-toplevel :execute)
 (defun power-of-two-ceiling (x)
   (declare (fixnum x))
   ;;(expt 2 (ceiling (log x 2)))
@@ -280,7 +280,7 @@
 
 ; In CMUCL we want to do type checking as early as possible; structures help this.
 
-(eval-when (compile load eval)
+(eval-when (:compile-toplevel :load-toplevel :execute)
 
 (defconstant wrapper-cache-number-vector-length
   kernel:layout-hash-length)
@@ -868,7 +868,7 @@
 ;;; to practically write my own compiler in order to get just this simple
 ;;; thing is something of a drag.
 ;;;
-(eval-when (compile load eval)
+(eval-when (:compile-toplevel :load-toplevel :execute)
 
 (defvar *cache* nil)
 
@@ -1388,7 +1388,7 @@
 ;;; This preallocation only creates about 25% more caches than PCL itself
 ;;; uses.  Some ports may want to preallocate some more of these.
 ;;; 
-(eval-when (load)
+(eval-when (:load-toplevel)
   (dolist (n-size '((1 513)(3 257)(3 129)(14 128)(6 65)(2 64)(7 33)(16 32)
 		    (16 17)(32 16)(64 9)(64 8)(6 5)(128 4)(35 2)))
     (let ((n (car n-size))
diff --git a/pcl/cmucl-documentation.lisp b/pcl/cmucl-documentation.lisp
index dbfef71f5..2fc9c2d15 100644
--- a/pcl/cmucl-documentation.lisp
+++ b/pcl/cmucl-documentation.lisp
@@ -4,7 +4,7 @@
 ;;; the public domain, and is provided 'as is'.
 ;;;
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/cmucl-documentation.lisp,v 1.7 1998/06/21 10:02:07 dtc Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/cmucl-documentation.lisp,v 1.8 2002/08/27 19:01:37 pmai Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -134,7 +134,7 @@
 
 ;;; Replace the minimal documentation function with the PCL version
 ;;; when loaded.
-(eval-when (load)
+(eval-when (:load-toplevel)
   (setf (symbol-function 'lisp:documentation) #'documentation)
   (setf (documentation 'documentation 'function)
     "Returns the documentation string of Doc-Type for X, or NIL if
diff --git a/pcl/defs.lisp b/pcl/defs.lisp
index afe91ee26..9f81139a0 100644
--- a/pcl/defs.lisp
+++ b/pcl/defs.lisp
@@ -27,7 +27,7 @@
 
 (in-package :pcl)
 
-(eval-when (compile load eval)
+(eval-when (:compile-toplevel :load-toplevel :execute)
   
 (defvar *defclass-times*   '(load eval))	;Probably have to change this
 						;if you use defconstructor.
@@ -44,7 +44,7 @@
 
 )
 
-(eval-when (load eval)
+(eval-when (:load-toplevel :execute)
   (when (eq *boot-state* 'complete)
     (error "Trying to load (or compile) PCL in an environment in which it~%~
             has already been loaded.  This doesn't work, you will have to~%~
diff --git a/pcl/defsys.lisp b/pcl/defsys.lisp
index cb5db3e00..c4f268c53 100644
--- a/pcl/defsys.lisp
+++ b/pcl/defsys.lisp
@@ -26,7 +26,7 @@
 ;;;
 
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/defsys.lisp,v 1.26 2002/08/26 02:40:55 pmai Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/defsys.lisp,v 1.27 2002/08/27 19:01:38 pmai Exp $")
 ;;;
 ;;; Some support stuff for compiling and loading PCL.  It would be nice if
 ;;; there was some portable make-system we could all agree to share for a
@@ -167,7 +167,7 @@ and load your system with:
     (cond ((null proper-extensions) '("l" . "lbin"))
           (t proper-extensions))))
 
-(eval-when (compile load eval)
+(eval-when (:compile-toplevel :load-toplevel :execute)
 
 (defun get-system (name)
   (get name 'system-definition))
diff --git a/pcl/dlisp3.lisp b/pcl/dlisp3.lisp
index 93e4e4cac..5e7fd45bb 100644
--- a/pcl/dlisp3.lisp
+++ b/pcl/dlisp3.lisp
@@ -26,12 +26,12 @@
 ;;;
 
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/dlisp3.lisp,v 1.4 1999/05/30 23:13:58 pw Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/dlisp3.lisp,v 1.5 2002/08/27 19:01:38 pmai Exp $")
 ;;;
 
 (in-package :pcl)
 
-(eval-when (compile load eval)
+(eval-when (:compile-toplevel :load-toplevel :execute)
 (defparameter checking-or-caching-list
   '((T NIL (CLASS) NIL)
     (T NIL (CLASS CLASS) NIL)
diff --git a/pcl/extensions.lisp b/pcl/extensions.lisp
index 463bf74bc..d3ce3c9c2 100644
--- a/pcl/extensions.lisp
+++ b/pcl/extensions.lisp
@@ -18,12 +18,12 @@
 ;;;
 
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/Attic/extensions.lisp,v 1.5 2002/08/26 02:23:13 pmai Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/Attic/extensions.lisp,v 1.6 2002/08/27 19:01:38 pmai Exp $")
 ;;;
 
 (in-package 'pcl)
 
-(eval-when (compile load eval)
+(eval-when (:compile-toplevel :load-toplevel :execute)
 
 (defvar *extensions-exports*
         '(set-standard-instance-access
diff --git a/pcl/fast-init.lisp b/pcl/fast-init.lisp
index 931722f5b..7fc4983c2 100644
--- a/pcl/fast-init.lisp
+++ b/pcl/fast-init.lisp
@@ -26,7 +26,7 @@
 ;;;
 
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/Attic/fast-init.lisp,v 1.8 2002/08/26 02:23:13 pmai Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/Attic/fast-init.lisp,v 1.9 2002/08/27 19:01:38 pmai Exp $")
 ;;;
 ;;; This file defines the optimized make-instance functions.
 ;;; 
@@ -152,7 +152,7 @@
 		(,',cached-name ,info))
 	      value)))))
 
-(eval-when (compile load eval)
+(eval-when (:compile-toplevel :load-toplevel :execute)
 (defparameter initialize-info-cached-slots
   '(valid-p				; t or (:invalid key)
     ri-valid-p
diff --git a/pcl/fin.lisp b/pcl/fin.lisp
index 26a276190..aeedd9eb1 100644
--- a/pcl/fin.lisp
+++ b/pcl/fin.lisp
@@ -26,7 +26,7 @@
 ;;;
 
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/fin.lisp,v 1.14 2001/03/13 15:49:47 pw Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/fin.lisp,v 1.15 2002/08/27 19:01:39 pmai Exp $")
 ;;;
 
   ;;   
@@ -110,7 +110,7 @@ explicitly marked saying who wrote it.
 ;;;       This must be SETF'able.
 ;;;       
 
-(eval-when (compile load eval)
+(eval-when (:compile-toplevel :load-toplevel :execute)
 (defconstant funcallable-instance-data
              '(wrapper slots)
   "These are the 'data-slots' which funcallable instances have so that
diff --git a/pcl/fsc.lisp b/pcl/fsc.lisp
index fdf45d27e..24671eb11 100644
--- a/pcl/fsc.lisp
+++ b/pcl/fsc.lisp
@@ -26,7 +26,7 @@
 ;;;
 
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/fsc.lisp,v 1.9 1999/05/30 23:14:00 pw Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/fsc.lisp,v 1.10 2002/08/27 19:01:39 pmai Exp $")
 ;;;
 ;;; This file contains the definition of the FUNCALLABLE-STANDARD-CLASS
 ;;; metaclass.  Much of the implementation of this metaclass is actually
@@ -96,7 +96,7 @@
 ;				 slot-name)
 ;	 nv))))
 ;
-;(eval-when (load)
+;(eval-when (:load-toplevel)
 ;  (pre-make-templated-function-constructor reader-function--fsc)
 ;  (pre-make-templated-function-constructor writer-function--fsc))
 
diff --git a/pcl/gray-streams.lisp b/pcl/gray-streams.lisp
index 8da7ae279..d82596b6f 100644
--- a/pcl/gray-streams.lisp
+++ b/pcl/gray-streams.lisp
@@ -4,7 +4,7 @@
 ;;; the Public domain, and is provided 'as is'.
 ;;;
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/gray-streams.lisp,v 1.6 2001/11/20 15:10:04 pw Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/gray-streams.lisp,v 1.7 2002/08/27 19:01:39 pmai Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -95,7 +95,7 @@
   t)
 
 
-(eval-when (compile)
+(eval-when (:compile-toplevel)
   (pushnew 'compile pcl::*defgeneric-times*))
 
 ;;; Character input streams.
diff --git a/pcl/macros.lisp b/pcl/macros.lisp
index 493ee6fc5..24e86e70f 100644
--- a/pcl/macros.lisp
+++ b/pcl/macros.lisp
@@ -26,7 +26,7 @@
 ;;;
 
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/macros.lisp,v 1.20 2002/08/26 16:58:06 pmai Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/macros.lisp,v 1.21 2002/08/27 19:01:39 pmai Exp $")
 ;;;
 ;;; Macros global variable definitions, and other random support stuff used
 ;;; by the rest of the system.
@@ -63,7 +63,7 @@
 ;;;    all sorts of lossage.  Common Lisp should explictly specify which
 ;;;    symbols appear in the Lisp package.
 ;;;
-(eval-when (compile load eval)
+(eval-when (:compile-toplevel :load-toplevel :execute)
 
 (defmacro memq (item list) `(member ,item ,list :test #'eq))
 (defmacro assq (item list) `(assoc ,item ,list :test #'eq))
diff --git a/pcl/precom1.lisp b/pcl/precom1.lisp
index 0c550d95d..645178e1a 100644
--- a/pcl/precom1.lisp
+++ b/pcl/precom1.lisp
@@ -36,7 +36,7 @@
 ;;; This preallocation only creates about 25% more caches than PCL itself
 ;;; uses need.  Some ports may want to preallocate some more of these.
 ;;; 
-(eval-when (load)
+(eval-when (:load-toplevel)
   (flet ((allocate (n size)
 	   (mapcar #'free-cache-vector
 		   (mapcar #'get-cache-vector
diff --git a/pcl/user-instances.lisp b/pcl/user-instances.lisp
index ef254dc2b..f8943d80d 100644
--- a/pcl/user-instances.lisp
+++ b/pcl/user-instances.lisp
@@ -20,7 +20,7 @@
 ;;;
 
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/Attic/user-instances.lisp,v 1.4 2002/08/26 02:23:16 pmai Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/Attic/user-instances.lisp,v 1.5 2002/08/27 19:01:40 pmai Exp $")
 ;;;
 
 (in-package 'pcl)
@@ -48,12 +48,12 @@
 ;;;
 
 #-pcl-user-instances
-(eval-when (compile load eval)
+(eval-when (:compile-toplevel :load-toplevel :execute)
 (error "Cannot use user-instances, since PCL was compiled without
         PCL-USER-INSTANCES on the *features* list (see pcl file low.lisp.)")
 )
 
-(eval-when (compile load eval)
+(eval-when (:compile-toplevel :load-toplevel :execute)
 (defclass user-vector-class-mixin () ()
   (:documentation
     "Use this mixin for metaclasses whose instances are USER-INSTANCES
@@ -129,7 +129,7 @@
 (defmacro get-user-instance-slots (x)
   `(user-vector-instance-slots ,x))
 
-(eval-when (eval load)
+(eval-when (:execute :load-toplevel)
   (force-compile 'user-instance-p)
   (force-compile 'user-instance-slots)
   (force-compile 'user-instance-wrapper)
diff --git a/pcl/walk.lisp b/pcl/walk.lisp
index b358342e0..31ffcb19c 100644
--- a/pcl/walk.lisp
+++ b/pcl/walk.lisp
@@ -26,7 +26,7 @@
 ;;;
 
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/walk.lisp,v 1.22 2002/08/26 02:23:16 pmai Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/pcl/walk.lisp,v 1.23 2002/08/27 19:01:40 pmai Exp $")
 ;;;
 ;;; A simple code walker, based IN PART on: (roll the credits)
 ;;;   Larry Masinter's Masterscope
@@ -384,7 +384,7 @@
 ;;;       walker.
 ;;;
 
-(eval-when (compile load eval)
+(eval-when (:compile-toplevel :load-toplevel :execute)
 
 (defmacro get-walker-template-internal (x) ;Has to be inside eval-when because
   `(get ,x 'walker-template))		   ;Golden Common Lisp doesn't hack
@@ -393,7 +393,7 @@
 
 (defmacro define-walker-template
 	  (name &optional (template '(nil repeat (eval))))
-  `(eval-when (load eval)
+  `(eval-when (:load-toplevel :execute)
      (setf (get-walker-template-internal ',name) ',template)))
 )
 
-- 
GitLab