home *** CD-ROM | disk | FTP | other *** search
- ;; San Marco LISP Explorer (TM)
- ;; release 2.0 of 22 Oct 84
- ;; Copyright (c) 1984 San Marco Associates
-
- ;;
- ;;aliases
- ;;
-
- ;;define an alias of a function
- (defmacro defalias args
- `(setf (symbol-function ',(first args))
- (symbol-function ',(second args))))
-
- ;;make <- be a message-send (funcall)
- (defalias <- funcall)
-
- ;;make defun-local be defun
- (defalias defun-local defun)
- (defalias defmacro-local defmacro)
-
- ;;make set-symbol be setq
- (defalias set-symbol setq)
- (defalias set-slocal setq)
-
-
- ;;
- ;;diskette selection
- ;;
- (defun exp-with-d (&rest args)
- (when (and *explorer-single-diskette-system*
- (boundp '*screen-active*)
- *screen-active*)
- (<- *query-io* :set-cursorpos 0 0)
- (%sysint #X10 #X200 0 0 0))
- (apply #'with-diskette args))
-
- (defun with-viewer (fn path &rest args)
- (apply #'exp-with-d
- *explorer-viewer-diskette*
- fn
- (merge-pathnames (merge-pathnames path ".fas")
- *explorer-viewer-pathname*)
- args))
-
- (defun with-slides (n fn path &rest args)
- (apply #'exp-with-d
- *explorer-slides-diskette*
- ;- (if (= n 1) *explorer-slides1-diskette* *explorer-slides2-diskette*)
- fn
- (merge-pathnames (merge-pathnames path ".tf")
- *explorer-slides-pathname*)
- ;- (merge-pathnames path (if (= n 1) *explorer-slides1-pathname*
- ;- *explorer-slides2-pathname*))
- args))
-
-
- ;;
- ;;environment variables
- ;;
-
- ;;default monitor type
- (set-symbol *explorer-color* *monitor-is-color*)
-
- ;;disk configuration
- (set-symbol *explorer-single-diskette-system* *single-diskette-drive-system*)
-
- ;;default resident modules
- (defvar *explorer-load-all-modules* nil)
-
-
- ;;
- ;;load variables
- ;;
- (set-symbol *explorer-core-modules*
- '#(base parameters display history exec inspect tutor-display tutor))
- (set-symbol *explorer-all-modules*
- '#(base instantiate parameters display
- history history-read history-write
- exec inspect tutor-display tutor itinerary
- tinspect rworld tworld bworld sworld blocks search
- ))
- (set-symbol *inspector-core-modules*
- '#(base parameters display exec tutor-display inspect))
-
- (set-symbol *explorer-core-loaded* nil)
- (set-symbol *explorer-all-loaded* nil)
- (set-symbol *inspector-core-loaded* nil)
-
- (set-symbol *utilities-load-message*
- "~%; It will take a minute or two to load the required programs.
- ; Now loading various GCLISP utilities.")
- (set-symbol *initial-load-message*
- "~%; Now loading the San Marco LISP Explorer (TM).")
- (set-symbol *inspector-load-message*
- "~%; Now loading the San Marco Inspector (TM).")
-
-
- ;;
- ;;loader
- ;;
- (defun explorer-load-base (&aux *load-verbose*)
- (%sysint #x10 (if *explorer-color* #x003 #x002) 0 0 0)
- (funcall *terminal-io* :set-cursorpos 0 0)
- (explorer-load-utildefs)
- (with-viewer #'fasload "overlay")
- (initialize-module-list)
- (load-module 'parameters)
- (source-load "unstruct")
- (autoload defstruct "defstruc"
- *lisp-library-pathname* *lisp-library-diskette*)
- )
-
- (defun explorer-load-utildefs ()
- (format t *utilities-load-message*)
- (with-viewer #'load "defstruc.lsp")
- (with-viewer #'load "wstream.lsp")
- (with-viewer #'load "macro.lsp")
- (with-viewer #'fasload "defs")
- (with-viewer #'fasload "basics")
- (with-viewer #'fasload "compress"))
-
- (defun explorer-load (directive)
- (cond (*explorer-all-loaded*)
- (*explorer-load-all-modules*
- (format t *initial-load-message*)
- (map-modules #'load-module *explorer-all-modules*)
- (setf *explorer-all-loaded* t))
- (*explorer-core-loaded*)
- ((eq directive :core)
- (format t *initial-load-message*)
- (map-modules #'load-module *explorer-core-modules*)
- (setf *explorer-core-loaded* t))
- (*inspector-core-loaded*)
- ((eq directive :inspect)
- (format t *inspector-load-message*)
- (map-modules #'load-module *inspector-core-modules*)
- (setf *inspector-core-loaded* t))))
-
-
- ;;
- ;;top level
- ;;
-
- (defun i-explore (args keyword directive)
- (case directive
- (:load
- (explorer-load-base)
- (i-explore-internal (first args) (rest args)))
- (:run
- (i-explore-internal (first args) (rest args)))
- (:unload
- (when (and (boundp '*last-loaded-lessons*) (fboundp 'get-lesson))
- (ignore-errors
- (dolist (l *last-loaded-lessons*) (setf (get-lesson l) nil))))
- (source-load "unexplor")
- (autoload i-explore "explore.lsp"
- *explorer-viewer-pathname* *explorer-viewer-diskette*)
- (autoload i-inspect "explore.lsp"
- *explorer-viewer-pathname* *explorer-viewer-diskette*)
- t)))
-
- (defun i-inspect (args keyword directive)
- (case directive
- (:load
- (explorer-load-base)
- (explorer-load :inspect)
- (using-modules *inspector-core-modules* (inspect-top-level args)))
- (:run
- (explorer-load :inspect)
- (using-modules *inspector-core-modules* (inspect-top-level args)))
- (:unload
- (source-load "unexplor")
- (autoload i-explore "explore.lsp"
- *explorer-viewer-pathname* *explorer-viewer-diskette*)
- (autoload i-inspect "explore.lsp"
- *explorer-viewer-pathname* *explorer-viewer-diskette*)
- t)))
-
- (defun i-explore-internal (directive args)
- (unless directive (setf directive :restart))
- (case directive
- ((:file :files)
- (mapc #'explorer-files args))
- ((:restart :help :itinerary)
- (explorer-load :core)
- (using-modules *explorer-core-modules*
- (catch :explorer-top-level (explore-top-level directive))))
- (otherwise
- (format t "
- ; Sorry, the argument ~S is not a known Explorer request.
- ; Please try again with one of these-- :HELP :ITINERARY :FILES
- ; or use no arguments at all to resume exploration normally.
- " directive)
- 'explorer-unknown-request)))
-