home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
me34src.zip
/
me3
/
mutt
/
builtin
/
require.mut
< prev
next >
Wrap
Text File
|
1995-01-14
|
1KB
|
34 lines
;; require.mut : Lisp like require. This code lets Mutt programs require
;; that certain modules or routines be loaded.
;; To use: In the MAIN rouine of your program file, add
;; (require Mutt-module-needed-by-this-program .mco-file-module-is-in)
;; where:
;; Mutt-module-needed-by-this-program is the name of a routine in the
;; module.
;; .mco-file-module-is-in is the name of the file that contains the
;; code for the module.
;; For example: If MAIN contains (require "foo" "bar.mut") or (require
;; "foo" "bar")), when your program is loaded it will load foo.mco if it
;; hasn't been already or routine foo is not present.
;; Notes:
;; It would be a good idea to also implememnt (provide ...) so I could
;; use a module name instead of mickey mousing with a routine name
;; (which might be screwed up by autoload). I could do this with a
;; list. Then again, ME has this this list internally (based on the
;; code file name).
;; C Durland 10/89 redone 9/91, 8/92 Public Domain
(defun
require (string Mutt-module Mutt-code-file)
{
(if (pgm-exists Mutt-module) (done))
(arg-prefix 42) ;; secret code to maybe load
(if (not (load Mutt-code-file)) ;; if can't load code
{
(msg "require: Could not load " Mutt-code-file)
(halt)
})
}
)