r11859: Canonicalize whitespace
[clsql.git] / sql / initialize.lisp
index 9fad818b05a7ada566e27067ab1cda80d0c8da41..fd06c3e004607e9ee4051f2246f5f2aa6acb852f 100644 (file)
@@ -4,7 +4,7 @@
 ;;;;
 ;;;; Name:          initialize.lisp
 ;;;; Purpose:       Initializion routines for backend
-;;;; Programmers:   Kevin M. Rosenberg 
+;;;; Programmers:   Kevin M. Rosenberg
 ;;;; Date Started:  May 2002
 ;;;;
 ;;;; $Id$
   (mapc #'database-type-load-foreign *loaded-database-types*))
 
 (defvar *default-database-type* nil
-  "Specifies the default type of database.")
+  "Designates the default database type which is initialised by
+  the function INITIALISE-DATABASE-TYPE.")
 
 (defvar *initialized-database-types* nil
-  "Contains a list of database types which have been initialized by calls
-to initialize-database-type.")
+  "A list of database types which have currently been initialised
+by calling INITIALIZE-DATABASE-TYPE.")
 
 (defun initialize-database-type (&key (database-type *default-database-type*))
-  "Initialize the given database-type, if it is not already
-initialized, as indicated by `*initialized-database-types*'."
+  "Initializes the supplied DATABASE-TYPE, if it is not already
+initialized, as indicated by *INITIALIZED-DATABASE-TYPES* and
+returns DATABASE-TYPE. *DEFAULT-DATABASE-TYPE* is set to
+DATABASE-TYPE and, if DATABASE-TYPE has not been initialised, it
+is added to *INITIALIZED-DATABASE-TYPES*. "
   (when (member database-type *initialized-database-types*)
     (return-from initialize-database-type database-type))
-  
-  (let ((system (intern (concatenate 'string 
-                         (symbol-name '#:clsql-)
-                         (symbol-name database-type)))))
+
+  (let ((system (intern (concatenate 'string
+                          (symbol-name '#:clsql-)
+                          (symbol-name database-type)))))
     (when (not (find-package system))
       (asdf:operate 'asdf:load-op system)))
-  
+
   (when (database-initialize-database-type database-type)
     (push database-type *initialized-database-types*)
+    (setf *default-database-type* database-type)
     database-type))