Replace more uses of DEFVAR with DEFPARAMETER

parent 164a297a
......@@ -190,7 +190,7 @@
;; and it outputs an anonymous function which is the effective method.
;;
(defvar *method-combinations* '())
(defparameter *method-combinations* '())
(defun install-method-combination (name function)
(setf (getf *method-combinations* name) function)
......
......@@ -35,8 +35,8 @@
;;; Restarts
(defvar *restart-clusters* ())
(defvar *condition-restarts* ())
(defparameter *restart-clusters* ())
(defparameter *condition-restarts* ())
;;; do we need copy-list if *restart-clusters* has only one element? Beppe
(defun compute-restarts (&optional condition)
......@@ -366,7 +366,7 @@
|#
(defvar *handler-clusters* nil)
(defparameter *handler-clusters* nil)
(defmacro handler-bind (bindings &body forms)
(unless (every #'(lambda (x) (and (listp x) (= (length x) 2))) bindings)
......
......@@ -13,18 +13,18 @@
;;; ----------------------------------------------------------------------
(defvar *method-size* 32) ; Size of methods hash tables
(defparameter *method-size* 32) ; Size of methods hash tables
;;; This holds fake methods created during bootstrap.
;;; It is an alist of:
;;; (method-name {method}+)
(defvar *early-methods* nil)
(defparameter *early-methods* nil)
;;;
;;; This is used by combined methods to communicate the next methods to
;;; the methods they call.
;;;
(defvar *next-methods* nil)
(defparameter *next-methods* nil)
;;; ----------------------------------------------------------------------
......
......@@ -167,6 +167,8 @@ the environment variable TMPDIR to a different value." template))
(defun static-lib-ar (lib object-files)
(let ((lib (brief-namestring lib)))
(when (probe-file lib)
(delete-file lib))
(safe-run-program *ar* (list* "cr" lib (mapcar #'brief-namestring object-files)))
(safe-run-program *ranlib* (list lib))))
......
......@@ -13,12 +13,12 @@
(in-package "SYSTEM")
(defvar *inspect-level* 0)
(defvar *inspect-history* nil)
(defvar *inspect-mode* nil)
(defparameter *inspect-level* 0)
(defparameter *inspect-history* nil)
(defparameter *inspect-mode* nil)
(defvar *old-print-level* nil)
(defvar *old-print-length* nil)
(defparameter *old-print-level* nil)
(defparameter *old-print-length* nil)
;; Either the inspector reads and writes everything on *standard-output*,
......
......@@ -55,9 +55,9 @@
;;; FOREIGN TYPES
;;;
(defvar *ffi-types* (make-hash-table :size 128))
(defparameter *ffi-types* (make-hash-table :size 128))
(defvar *use-dffi* t)
(defparameter *use-dffi* t)
(defmacro def-foreign-type (name definition)
`(eval-when (:compile-toplevel :load-toplevel :execute)
......@@ -310,7 +310,7 @@
;;; POINTERS
;;;
(defvar +null-cstring-pointer+ (si:allocate-foreign-data :pointer-void 0))
(defparameter +null-cstring-pointer+ (si:allocate-foreign-data :pointer-void 0))
(defun pointer-address (ptr)
(si::foreign-data-address ptr))
......@@ -582,7 +582,7 @@
(define-symbol-macro ,lisp-name
(ffi:deref-pointer (get-sysprop ',lisp-name 'ffi-foreign-var) ',type)
)))
`(defvar ,lisp-name ,inline-form))
`(defparameter ,lisp-name ,inline-form))
)))
(defun find-foreign-library (names directories &key drive-letters types)
......@@ -619,7 +619,7 @@
)))))
nil)
(defvar +loaded-libraries+ nil)
(defparameter +loaded-libraries+ nil)
(defun do-load-foreign-library (tmp &optional system-library)
(let* ((path (cond ((pathnamep tmp) tmp)
......
......@@ -90,7 +90,7 @@
;;; DO NOT EVEN THINK OF ATTEMPTING TO UNDERSTAND THIS CODE WITHOUT READING
;;; THE PAPER!
(defvar *digits* "0123456789")
(defparameter *digits* "0123456789")
(defun flonum-to-string (x &optional width fdigits scale fmin)
(declare (type float x))
......@@ -225,18 +225,18 @@
:end (format-directive-end struct))))
#+formatter
(defvar *format-directive-expanders*
(defparameter *format-directive-expanders*
(make-array char-code-limit :initial-element nil))
(defvar *format-directive-interpreters*
(defparameter *format-directive-interpreters*
(make-array char-code-limit :initial-element nil))
(defvar *default-format-error-control-string* nil)
(defvar *default-format-error-offset* nil)
(defparameter *default-format-error-control-string* nil)
(defparameter *default-format-error-offset* nil)
;; If this flag is 1, directives ~W, ~_, ~<...~:>, ~I or ~T were found.
;; If the flag is 2, directive ~<...~:;...~> was found.
;; NIL otherwise.
(defvar *output-layout-mode* nil)
(defparameter *output-layout-mode* nil)
;; The condition FORMAT-ERROR is found later in conditions.lsp
......@@ -358,14 +358,14 @@
;;; Used both by the expansion stuff and the interpreter stuff. When it is
;;; non-NIL, up-up-and-out (~:^) is allowed. Otherwise, ~:^ isn't allowed.
;;;
(defvar *up-up-and-out-allowed* nil)
(defparameter *up-up-and-out-allowed* nil)
;;; *LOGICAL-BLOCK-POPPER* -- internal.
;;;
;;; Used by the interpreter stuff. When it non-NIL, its a function that will
;;; invoke PPRINT-POP in the right lexical environemnt.
;;;
(defvar *logical-block-popper* nil)
(defparameter *logical-block-popper* nil)
;;; *EXPANDER-NEXT-ARG-MACRO* -- internal.
;;;
......@@ -373,7 +373,7 @@
;;; can change it.
;;;
#+formatter
(defvar *expander-next-arg-macro* 'expander-next-arg)
(defparameter *expander-next-arg-macro* 'expander-next-arg)
;;; *ONLY-SIMPLE-ARGS* -- internal.
;;;
......@@ -390,7 +390,7 @@
;;; again with it bound to T. If this is T, we don't try to do anything
;;; fancy with args.
;;;
(defvar *orig-args-available* nil)
(defparameter *orig-args-available* nil)
;;; *SIMPLE-ARGS* -- internal.
;;;
......
......@@ -104,7 +104,7 @@
(progn
(setq *documentation-pool* (list (make-hash-table :test #'equal :size 128)
"SYS:help.doc"))
(defvar *keep-documentation* t))
(defparameter *keep-documentation* t))
(defun new-documentation-pool (&optional (size 1024))
"Args: (&optional hash-size)
......
......@@ -196,7 +196,7 @@ printed. If FORMAT-STRING is NIL, however, no prompt will appear."
(set-dispatch-macro-character #\# #\s 'sharp-s-reader)
(set-dispatch-macro-character #\# #\S 'sharp-s-reader)
(defvar *dribble-closure* nil)
(defparameter *dribble-closure* nil)
(defun dribble (&optional (pathname "DRIBBLE.LOG" psp))
"Args: (&optional filespec)
......
......@@ -565,7 +565,7 @@ The offending clause"
(declare (ignore data-type))
substitutable-expression)
(defvar loop-floating-point-types
(defparameter loop-floating-point-types
'(flonum float short-float single-float double-float long-float))
(defun loop-typed-init (data-type)
......@@ -914,7 +914,7 @@ The offending clause"
(declare (fixnum ans))
(and (< ans 20.) ans)))))
(defvar loop-simplep
(defparameter loop-simplep
'(> < <= >= /= + - 1+ 1- ash equal atom setq prog1 prog2 and or = aref char schar sbit svref))
(defun loop-simplep-1 (x)
......
......@@ -145,7 +145,7 @@
#-Genera `(copy-list ,l)
)
(defvar *loop-real-data-type* 'real)
(defparameter *loop-real-data-type* 'real)
(defun loop-optimization-quantities (env)
(declare (si::c-local))
......@@ -321,7 +321,7 @@ constructed.
infinity-data)
(defvar *loop-minimax-type-infinities-alist*
(defparameter *loop-minimax-type-infinities-alist*
;; This is the sort of value this should take on for a Lisp that has
;; "eminently usable" infinities. n.b. there are neither constants nor
;; printed representations for infinities defined by CL.
......@@ -528,7 +528,7 @@ code to be loaded.
;;;; Setq Hackery
(defvar *loop-destructuring-hooks*
(defparameter *loop-destructuring-hooks*
nil
"If not NIL, this must be a list of two things:
a LET-like macro, and a SETQ-like macro, which perform LOOP-style destructuring.")
......@@ -554,7 +554,7 @@ a LET-like macro, and a SETQ-like macro, which perform LOOP-style destructuring.
var-val-pairs)))
(defvar *loop-desetq-temporary*
(defparameter *loop-desetq-temporary*
(make-symbol "LOOP-DESETQ-TEMP"))
......@@ -764,11 +764,11 @@ a LET-like macro, and a SETQ-like macro, which perform LOOP-style destructuring.
;;;; LOOP Iteration Optimization
(defvar *loop-duplicate-code*
(defparameter *loop-duplicate-code*
nil)
(defvar *loop-iteration-flag-variable*
(defparameter *loop-iteration-flag-variable*
(make-symbol "LOOP-NOT-FIRST-TIME"))
......@@ -868,7 +868,7 @@ a LET-like macro, and a SETQ-like macro, which perform LOOP-style destructuring.
ans)))
(defvar *special-code-sizes*
(defparameter *special-code-sizes*
'((return 0) (progn 0)
(null 1) (not 1) (eq 1) (car 1) (cdr 1)
(when 1) (unless 1) (if 1)
......@@ -880,7 +880,7 @@ a LET-like macro, and a SETQ-like macro, which perform LOOP-style destructuring.
(cddaar 4) (cddadr 4) (cdddar 4) (cddddr 4)))
(defvar *estimate-code-size-punt*
(defparameter *estimate-code-size-punt*
'(block
do do* dolist
flet
......
......@@ -19,11 +19,11 @@
;;;; exported specials
(defvar *modules* ()
(defparameter *modules* ()
"This is a list of module names that have been loaded into Lisp so far.
It is used by PROVIDE and REQUIRE.")
(defvar *module-provider-functions* nil
(defparameter *module-provider-functions* nil
"See function documentation for REQUIRE")
;;;; PROVIDE and REQUIRE
......@@ -34,7 +34,7 @@ Module-name is a string designator"
(pushnew (string module-name) *modules* :test #'string=)
t)
(defvar *requiring* nil)
(defparameter *requiring* nil)
(defun require-error (control &rest arguments)
(error "Module error: ~?" control arguments))
......
......@@ -24,29 +24,29 @@
(export '(*break-readtable* *break-on-warnings*
*tpl-evalhook* *tpl-prompt-hook*))
(defvar *quit-tag* (cons nil nil))
(defvar *quit-tags* nil)
(defvar *break-level* 0) ; nesting level of error loops
(defvar *break-env* nil)
(defvar *ihs-base* 0)
(defvar *ihs-top* (ihs-top))
(defvar *ihs-current* 0)
(defvar *frs-base* 0)
(defvar *frs-top* 0)
(defvar *tpl-continuable* t)
(defvar *tpl-prompt-hook* nil)
(defvar *eof* (cons nil nil))
(defvar *last-error* nil)
(defvar *break-message* nil)
(defvar *break-readtable* nil)
(defvar *tpl-level* -1) ; nesting level of top-level loops
(defvar *step-level* 0) ; repeated from trace.lsp
(defvar *break-hidden-functions* '(error cerror apply funcall invoke-debugger))
(defvar *break-hidden-packages* (list #-ecl-min (find-package 'system)))
(defparameter *quit-tag* (cons nil nil))
(defparameter *quit-tags* nil)
(defparameter *break-level* 0) ; nesting level of error loops
(defparameter *break-env* nil)
(defparameter *ihs-base* 0)
(defparameter *ihs-top* (ihs-top))
(defparameter *ihs-current* 0)
(defparameter *frs-base* 0)
(defparameter *frs-top* 0)
(defparameter *tpl-continuable* t)
(defparameter *tpl-prompt-hook* nil)
(defparameter *eof* (cons nil nil))
(defparameter *last-error* nil)
(defparameter *break-message* nil)
(defparameter *break-readtable* nil)
(defparameter *tpl-level* -1) ; nesting level of top-level loops
(defparameter *step-level* 0) ; repeated from trace.lsp
(defparameter *break-hidden-functions* '(error cerror apply funcall invoke-debugger))
(defparameter *break-hidden-packages* (list #-ecl-min (find-package 'system)))
(defconstant tpl-commands
'(("Top level commands"
......@@ -159,7 +159,7 @@
:exit &eval &optional status [Top level Command]~%")
)))
(defvar *tpl-commands* tpl-commands)
(defparameter *tpl-commands* tpl-commands)
(defconstant break-commands
'("Break commands"
......@@ -381,7 +381,7 @@
See also: :variables.~%")
))
(defvar *lisp-initialized* nil)
(defparameter *lisp-initialized* nil)
(defun top-level (&optional (process-command-line nil))
"Args: ()
......@@ -413,11 +413,11 @@ under certain conditions; see file 'Copyright' for details.")
#+threads
(progn
(defvar *console-lock* (mp:make-lock :name "Console lock"))
(defparameter *console-lock* (mp:make-lock :name "Console lock"))
#-:win32
(defvar *console-available* (mp:make-condition-variable))
(defvar *console-owner* nil)
(defvar *console-waiting-list* '())
(defparameter *console-available* (mp:make-condition-variable))
(defparameter *console-owner* nil)
(defparameter *console-waiting-list* '())
(defun candidate-to-get-console-p (process)
(or (null *console-owner*)
......@@ -465,8 +465,8 @@ under certain conditions; see file 'Copyright' for details.")
(delete-from-waiting-list mp:*current-process*)
(release-console mp:*current-process*)))
(defvar *allow-recursive-debug* nil)
(defvar *debug-status* nil)
(defparameter *allow-recursive-debug* nil)
(defparameter *debug-status* nil)
(defun simple-terminal-interrupt ()
(error 'ext:interactive-interrupt))
......@@ -496,7 +496,7 @@ Use special code 0 to cancel this operation.")
(t
(format t "~&Not a valid process number")))))
(defvar *interrupt-lonely-threads-p* t)
(defparameter *interrupt-lonely-threads-p* t)
(defun single-threaded-terminal-interrupt ()
(restart-case (simple-terminal-interrupt)
......@@ -656,7 +656,7 @@ Use special code 0 to cancel this operation.")
(t
(return (read))))))
(defvar *debug-tpl-commands* nil)
(defparameter *debug-tpl-commands* nil)
(defun harden-command (cmd-form)
`(block
......@@ -1268,7 +1268,7 @@ Use special code 0 to cancel this operation.")
(defun tpl-untrace-command (&rest functions)
(untrace* functions))
(defvar *tpl-last-load* nil)
(defparameter *tpl-last-load* nil)
(defun tpl-load-command (&rest files)
(when files
......@@ -1276,7 +1276,7 @@ Use special code 0 to cancel this operation.")
(dolist (file *tpl-last-load*) (load file))
*tpl-last-load*)
(defvar *tpl-last-compile* nil)
(defparameter *tpl-last-compile* nil)
(defun tpl-compile-command (&rest files)
(when files
......@@ -1368,7 +1368,7 @@ package."
commands)
(nconc commands (list restart-commands))))
(defvar *default-debugger-maximum-depth* 16)
(defparameter *default-debugger-maximum-depth* 16)
(defun check-default-debugger-runaway ()
(when (< *default-debugger-maximum-depth* *break-level*)
......
......@@ -12,9 +12,9 @@
(in-package "SYSTEM")
(defvar *trace-level* 0)
;; (defvar *trace-list* nil) ; In all_symbols.d !
(defvar *trace-max-indent* 20)
(defparameter *trace-level* 0)
;; (defparameter *trace-list* nil) ; In all_symbols.d !
(defparameter *trace-max-indent* 20)
(defmacro trace (&rest r)
"Syntax: (trace ({function-name | ({function-name}+)} {keyword [form]\}*)
......@@ -59,7 +59,7 @@ all functions."
(defun untrace* (r)
(mapc #'untrace-one (or r (trace* nil))))
(defvar *inside-trace* nil)
(defparameter *inside-trace* nil)
(defun trace-one (spec)
(let* (break exitbreak (entrycond t) (exitcond t) entry exit
......@@ -221,11 +221,11 @@ all functions."
(delete-from-trace-list fname)
(values)))
(defvar *step-level* 0)
(defvar *step-action* nil)
(defvar *step-form* nil)
(defvar *step-tag* (cons nil nil))
(defvar *step-functions* nil)
(defparameter *step-level* 0)
(defparameter *step-action* nil)
(defparameter *step-form* nil)
(defparameter *step-tag* (cons nil nil))
(defparameter *step-functions* nil)
(defconstant step-commands
`("Stepper commands"
((:newline) (step-next) :constant
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment