Added initialize function as a hook to be called from implementation specific image startup.

Pascal J. Bourguignon [2015-07-16 21:04]
Added initialize function as a hook to be called from implementation specific image startup.
Filename
common-lisp/interactive/interactive.lisp
diff --git a/common-lisp/interactive/interactive.lisp b/common-lisp/interactive/interactive.lisp
index 30eecec..e0255a1 100644
--- a/common-lisp/interactive/interactive.lisp
+++ b/common-lisp/interactive/interactive.lisp
@@ -52,7 +52,8 @@
            "REPL-HISTORY-READER-MACRO"
            "MORE" "LESS" "CAT" "LS" "POPD" "PUSHD" "PWD" "CD"
            "BROWSE" "LIST-EXTERNAL-SYMBOLS" "LIST-ALL-SYMBOLS"
-           "DEFINE-PACKAGE")
+           "DEFINE-PACKAGE"
+           "INITIALIZE")
   (:import-from "COM.INFORMATIMAGO.COMMON-LISP.CESARUM.PACKAGE"
                 "LIST-EXTERNAL-SYMBOLS" "LIST-ALL-SYMBOLS" "DEFINE-PACKAGE")
   (:import-from "COM.INFORMATIMAGO.COMMON-LISP.CESARUM.UTILITY"
@@ -594,6 +595,10 @@ DO:         Create FILE if it doesn't exist, and
 (defvar *start-time* (get-universal-time)
   "Records the time at which this Common Lisp instance was started.")

+(defun initialize ()
+  "This function should be called upon launching a lisp image."
+  (setf *start-time* (get-universal-time)))
+
 (defun uptime ()
   "Prints the uptime of this Common Lisp instance."
   (let ((uptime  (- (get-universal-time) *start-time*)))
ViewGit