;;;; -*- Mode: LISP; Syntax: Common-Lisp; Base: 10 -*- ;;;; --------------------------------------------------------------------------- ;;;; File name: defsys.lsp ;;;; System: FIRE Knowledge Base Browser System ;;;; Author: Shawn Nicholson ;;;; Created: June 18, 2001 08:24:37 ;;;; Purpose: ;;;; --------------------------------------------------------------------------- ;;;; Modified: Monday, May 26, 2003 at 15:35:06 by nicholson ;;;; --------------------------------------------------------------------------- (in-package :common-lisp-user) #-qrg (error "You must first load qrg-setup.lisp.") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Load defsys for other modules required by this system if any #-fire (error "Fire Graphs is not an independent system from FIRE. Please see FIRE's defsys for loading.") (unless (member :zgraph *features*) (qrg:load-qrg-defsys "zgraph" "v8") ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Set up packages (eval-when (:compile-toplevel :load-toplevel :execute) (defpackage :fire-graphs (:use :common-lisp :qrg))) ;;Provide the ability to move data to a separate package in the future. (eval-when (:compile-toplevel :load-toplevel :execute) (unless (find-package :data) (rename-package (find-package :cl-user) :common-lisp-user ;keep name the same '(:cl-user :user ;replace standard nicknames :data)))) ;add a new nickname (in-package :fire-graphs) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Global variables (defconstant *fire-graphs-version* "v1") ;; current version number (defparameter *fire-graphs-path* (qrg:make-qrg-path "fire" "v1" "Fire-Graphs" *fire-graphs-version*)) (defparameter *fire-graphs-files* nil) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; PackDoc stuff (eval-when (:load-toplevel :compile-toplevel :execute) (defmacro export-symbols (subpackage-name doc-string symbols) "Assigns a name and documentation to the group of symbols and exports them from the current package. If PackDoc has been loaded, subpackage documentation will also be generated." `(progn (export ,symbols) (when (member :packdoc *features*) (funcall (intern :subpackage-documentation :packdoc) ,subpackage-name ,symbols ,doc-string))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Load the export file (qrg:load-file *fire-graphs-path* "export" :action :load-source :verbose t) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; List the system files (setq *fire-graphs-files* '("fire-isa-graph" )) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Define the system's loading function (defun explain-usage () (format t "~%~%To run: ~%") ) (defun load-fire-graphs (&key (action :source-if-newer) (verbose t) (force-load t)) (cond ((and (not force-load) (member :fire-graphs qrg:*modules-loaded*)) (when verbose (format t "~%;;; FIRE Graphs System already loaded."))) (t ;; Loading the Zgraph System (when (not (member :zgraph qrg:*modules-loaded*)) (when verbose (format t "Loading Zgraph System~%")) (zgraph::load-zgraph :action action :verbose verbose)) ;; Load the FIRE Graphs System (when verbose (format t "Loading FIRE Graphs System~%")) (load-files *fire-graphs-path* *fire-graphs-files* :action action :verbose verbose) (pushnew :fire-graphs *features*) (pushnew :fire-graphs qrg:*modules-loaded*))) (explain-usage) :done) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; End of Code