From 4e8ffca8b200d962e1f87191a7015bdc27b8610e Mon Sep 17 00:00:00 2001
From: dos-reis <gdr@axiomatics.org>
Date: Sun, 17 Aug 2008 20:20:36 +0000
Subject: 	* interp/sys-globals.boot ($verbose): Move from
 sys-driver.boot. 	(initializeGlobalState): Set it and honor it. 	*
 interp/daase.lisp (initial-getdatabase): Be talkative only when 	asked.

---
 src/ChangeLog               |  7 +++++++
 src/interp/daase.lisp       | 30 ++++++++++++++++++++----------
 src/interp/sys-driver.boot  | 17 ++++++-----------
 src/interp/sys-globals.boot |  5 +++++
 4 files changed, 38 insertions(+), 21 deletions(-)

diff --git a/src/ChangeLog b/src/ChangeLog
index b6a2edd0..733c178d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
+2008-08-17  Gabriel Dos Reis  <gdr@cs.tamu.edu>
+
+	* interp/sys-globals.boot ($verbose): Move from sys-driver.boot.
+	(initializeGlobalState): Set it and honor it.
+	* interp/daase.lisp (initial-getdatabase): Be talkative only when
+	asked. 
+
 2008-08-17  Gabriel Dos Reis  <gdr@cs.tamu.edu>
 
 	* interp/sys-globals.boot ($updateCatTableIfTrue): Default to false.
diff --git a/src/interp/daase.lisp b/src/interp/daase.lisp
index 380965e6..8eabf2ef 100644
--- a/src/interp/daase.lisp
+++ b/src/interp/daase.lisp
@@ -364,7 +364,8 @@
 (defun initial-getdatabase ()
   "fetch data we want in the saved system"
   (let (hascategory constructormodemapAndoperationalist operation constr)
-    (format t "Initial getdatabase~%")
+    (when |$verbose|
+      (format t "Initial getdatabase~%"))
     (setq hascategory '(
 			(|Equation| . |Ring|)
 			(|Expression| . |CoercibleTo|)
@@ -533,14 +534,18 @@
     (dolist (con constr)
       (let ((c (|getSystemModulePath| 
 		(string (|getConstructorAbbreviationFromDB| con)))))
-	(format t "   preloading ~a.." c)
+	(when |$verbose|
+	  (format t "   preloading ~a.." c))
 	(if (probe-file c)
 	    (progn
 	      (put con 'loaded c)
 	      (|loadModule| c con)
-	      (format t "loaded.~%"))
-	  (format t "skipped.~%"))))
-    (format t "~%")))
+	      (when |$verbose|
+		(format t "loaded.~%")))
+	  (when |$verbose|
+	    (format t "skipped.~%")))))
+    (when |$verbose|
+      (format t "~%"))))
 
 ; format of an entry in interp.daase:
 ;  (constructor-name
@@ -564,7 +569,8 @@
     (setq *interp-stream* (open (|pathToDatabase| "interp.daase")))
     (setq stamp (read *interp-stream*))
     (unless (equal stamp *interp-stream-stamp*)
-      (format t "   Re-reading interp.daase")
+      (when |$verbose|
+	(format t "   Re-reading interp.daase"))
       (setq *interp-stream-stamp* stamp)
       (setq pos (car stamp))
       (file-position *interp-stream* pos)
@@ -619,7 +625,8 @@
     (setq *browse-stream* (open (|pathToDatabase| "browse.daase")))
     (setq stamp (read *browse-stream*))
     (unless (equal stamp *browse-stream-stamp*)
-      (format t "   Re-reading browse.daase")
+      (when |$verbose|
+	(format t "   Re-reading browse.daase"))
       (setq *browse-stream-stamp* stamp)
       (setq pos (car stamp))
       (file-position *browse-stream* pos)
@@ -648,7 +655,8 @@
     (setq *category-stream* (open (|pathToDatabase| "category.daase")))
     (setq stamp (read *category-stream*))
     (unless (equal stamp *category-stream-stamp*)
-      (format t "   Re-reading category.daase")
+      (when |$verbose|
+	(format t "   Re-reading category.daase"))
       (setq *category-stream-stamp* stamp)
       (setq pos (car stamp))
       (file-position *category-stream* pos)
@@ -665,7 +673,8 @@
     (setq *operation-stream* (open (|pathToDatabase| "operation.daase")))
     (setq stamp (read *operation-stream*))
     (unless (equal stamp *operation-stream-stamp*)
-      (format t "   Re-reading operation.daase")
+      (when |$verbose|
+	(format t "   Re-reading operation.daase"))
       (setq *operation-stream-stamp* stamp)
       (setq pos (car stamp))
       (file-position *operation-stream* pos)
@@ -1349,7 +1358,8 @@
     (open (|pathToDatabase| "compress.daase") :direction :input))
   (setq stamp (read *compress-stream*))
   (unless (equal stamp *compress-stream-stamp*)
-   (format t "   Re-reading compress.daase")
+    (when |$verbose|
+      (format t "   Re-reading compress.daase"))
    (setq *compress-stream-stamp* stamp)
    (setq pos (car stamp))
    (file-position *compress-stream* pos)
diff --git a/src/interp/sys-driver.boot b/src/interp/sys-driver.boot
index 05c39858..0a2e1f06 100644
--- a/src/interp/sys-driver.boot
+++ b/src/interp/sys-driver.boot
@@ -50,10 +50,6 @@ $SpadServerName == '"/tmp/.d"
 ++ true means that the core executable acts as remote server.
 $SpadServer := false
 
-++ if true, then the interpreter or compiler should inform about 
-++ code generation, etc.
-$verbose := true
-
 $PrintCompilerMessageIfTrue := true
 
 ++
@@ -187,6 +183,7 @@ initializeGlobalState() ==
   $SPAD := true
   $buildingSystemAlgebra := 
     getOptionValue(Option '"system-algebra",%systemOptions())
+  $verbose := getOptionValue(Option '"verbose",%systemOptions())
   GCMSG(NIL)
   if have_to then
     $superHash := MAKE_-HASHTABLE('UEQUAL)
@@ -196,12 +193,12 @@ initializeGlobalState() ==
   if have_to then buildHtMacroTable()
 
   -- 2. History
-  if $displayStartMsgs then 
+  if $verbose and $displayStartMsgs then 
     sayKeyedMsg("S2IZ0053",['"history"])
   initHist()
 
   -- 3. Databases
-  if $displayStartMsgs then 
+  if $verbose and $displayStartMsgs then 
     sayKeyedMsg("S2IZ0053",['"database"])
   if have_to then  -- ??? remove this functiom from the system?
     SETF(SYMBOL_-FUNCTION "addConsDB", function IDENTITY)
@@ -212,7 +209,7 @@ initializeGlobalState() ==
     openDatabases()
 
   -- 4. Constructors
-  if $displayStartMsgs then 
+  if $verbose and $displayStartMsgs then 
     sayKeyedMsg("S2IZ0053",['"constructors"])
   loadExposureGroupData()
   if have_to then makeConstructorsAutoLoad()
@@ -223,7 +220,7 @@ initializeGlobalState() ==
 
   -- 6. Interpreter
   if have_to then
-    if $displayStartMsgs then 
+    if $verbose and $displayStartMsgs then 
       sayKeyedMsg("S2IZ0053",['"interpreter"])
     initializeTimedNames($interpreterTimedNames,$interpreterTimedClasses)
     statisticsInitialization()
@@ -241,12 +238,10 @@ initializeGlobalState() ==
 executeSpadScript(progname,options,file) ==
   $displayStartMsgs := false
   initializeGlobalState()
-  if getOption(Option '"verbose",%systemOptions()) then
-    $verbose := true
+  if $verbose then
     $options := []
     $ProcessInteractiveValue := false
   else
-    $verbose := false
     $options := [["quiet"]]
     $ProcessInteractiveValue := true
   $PrintCompilerMessageIfTrue := $verbose
diff --git a/src/interp/sys-globals.boot b/src/interp/sys-globals.boot
index e42e9a91..780a0455 100644
--- a/src/interp/sys-globals.boot
+++ b/src/interp/sys-globals.boot
@@ -473,3 +473,8 @@ $ErrorStream :=
 
 ++ True if we are building the system algebra.
 $buildingSystemAlgebra := false
+
+++ if true, then the interpreter or compiler should inform about 
+++ code generation, etc.
+$verbose := true
+
-- 
cgit v1.2.3