![]() | ![]() | ![]() | Starting Up | ![]() |
GBBopen is packaged with its own module system that
supports compiling and loading GBBopen components. The Module Manager Facility
is designed for ease of use and for simplicity in porting to Common Lisp
implementations. For example, to compile all core GBBopen modules and
execute a basic trip-tests file, you only need to evaluate the following forms
within your Common Lisp environment:
> (load "<install-dir>/startup.lisp")
;; Loading <install-dir>/startup.lisp
;; GBBopen is installed in <install-dir>
;; Your "home" directory is <homedir>
;; Loading <install-dir>/source/module-manager/module-manager-loader.lisp
;; Loading <install-dir>/source/module-manager/module-manager.lisp
;; Loading <install-dir>/source/module-manager/module-manager-user.lisp
;; Loading <install-dir>/source/modules.lisp
;; No shared module definitions were found in <install-dir>/shared-gbbopen-modules/.
;; No personal module definitions were found in <homedir>/gbbopen-modules/.
T
> (module-manager:compile-module :gbbopen-test :propagate :create-dirs)
;; Compiling <install-dir>/source/module-manager/module-manager.lisp
...
;; Running basic GBBopen tests...
...
>
GBBopen should compile, load, and run the basic tests file without error.
If you are running GBBopen on Windows, note that backslash is the escape character in the standard Common Lisp reader; it causes the next character to treated as a normal character rather than as having any special syntactic characteristics. So, each backslash in a file-specification string must be entered as two backslash characters. For example:
> (load "c:\\GBBopen\\startup.lisp")As can be seen from the file-loading messages, the
startup.lispsource/module-manager/module-manager-loader.lispsource/module-manager/module-manager.lispsource/module-manager/module-manager-user.lispsource/modules.lispThe :propagate option to :create-dirs
If a gbbopen-init.lisp<install-directory>/startup.lisp<homedir>/gbbopen-init.lisp
Here is a simple example of a personal
<homedir>/gbbopen-init.lisp:my-app-root:my-app
;;;; -*- Mode:Common-Lisp; Package:CL-USER -*-
(in-package :cl-user)
(module-manager:define-root-directory :my-app-root
(make-pathname :directory "~/my-app"))
(module-manager:define-module :my-app
(:requires :gbbopen-user)
(:directory :my-app-root)
(:files "my-file"))
;;; ===============================================
;;; End of File
;;; ===============================================
For shared or more substantial application modules, we recommend a
packaging convention that mirrors that of GBBopen. This will be discussed
shortly in conjunction with using a personal
gbbopen-modules
Next, we show how to add convenient GBBopen keyword commands to the
top level read-eval-print loop (REPL) in your Common Lisp environment and how
to define a personal REPL command that makes it easy to compile and
load the :my-app
<install-directory>/initiate.lisp<install-directory>/startup.lispTo make GBBopen's REPL commands available, simply load
<install-directory>/initiate.lisp<install-directory>/startup.lisp<install-directory>/initiate.lisp<install-directory>/startup.lisp
Built-in and GBBopen REPL commands are defined in the file
<install-directory>/commands.lisp
> (:gbbopen-test :create-dirs)
...
>
or
> :gbbopen-test :create-dirs
...
>
However, Allegro CL,
CLISP, and
LispWorks do not support the list
notation. CLISP versions prior to 2.45 and
ECL only support the spread
notation—but without arguments.
Equivalent functions in the :common-lisp-user
gbbopen-commands.lispgbbopen-commandsinitiate.lispgbbopen-commands.lisp:my-appcl-user::my-app:my-app
;;;; -*- Mode:Common-Lisp; Package:CL-USER -*-
(in-package :cl-user)
(define-repl-command :my-app (&rest options)
"Compile and load my GBBopen application module"
(startup-module :my-app options :gbbopen-user))
;;; ===============================================
;;; End of File
;;; ===============================================
The macro <install-directory>/initiate.lisp<install-directory>/initiate.lisp<install-directory>/startup.lisp
Previously, we showed a simple example of using a personal
gbbopen-init.lisp:my-app
If a gbbopen-modulesuser-homedir-pathnamegbbopen-modulesgbbopen-modules
Each application directory can contain:
modules.lisp file that contains module definitions
(loaded after the personal gbbopen-init.lispsource containing all the source files for the
module or application
commands.lisp file that specifies
REPL commands for the module (loaded after the personal
gbbopen-commands.lispWe highly recommend following this packaging convention, which mirrors that of
GBBopen itself. It is very easy to create, use, and share modules
defined in this way by placing symbolic links to the module directories in
your personal gbbopen-modules.sym (that contains the target directory path as its sole line) as a
stand-in for the symbolic link.
There is also an
<install-directory>/shared-gbbopen-modulesgbbopen-modulesshared-gbbopen-modules
This is the recommended mechanism for installation-wide managing and sharing of modules and applications.
:os-interface*preferred-browser*gbbopen-init.lispstartup.lispEmacs access to the
GBBopen Hyperdoc is provided by
<install-directory>/browse-hyperdoc.elbrowse-hyperdocMETA-?<install-directory>/browse-hyperdoc.el.emacs initialization file.
If you already use the
hyperspec.elbrowse-hyperdoccommon-lisp-hyperspec-root.emacs
initialization file to point to your local copy of the HyperSpec. For
example:
(setf common-lisp-hyperspec-root "file:/usr/local/CLHS/")
Highly recommended!
Entities
The GBBopen Project
![]() | ![]() | ![]() | Starting Up | ![]() |