Ignore:
Timestamp:
02/11/10 12:03:56 (14 years ago)
Author:
Mark Evenson
Message:

REQUIRE now searches for ASDF systems.

If ASDF is loaded via (REQUIRE 'ASDF), all subsequent invocations of
REQUIRE will search for a loadable ASDF system definitions if the
default resolver mechanism fails.

SYS::*MODULE-PROVIDER-FUNCTIONS* now contains a customizable list of
module provider functions. Such a function takes a single argument of
the module that should be resolved and loaded. There is a builtin
resolver #'SYS::MODULE-PROVIDE-SYSTEM that implicitly called before
any functions in this variable.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/require.lisp

    r11391 r12447  
    3737  t)
    3838
     39(defun module-provide-system (module)
     40  (let ((*readtable* (copy-readtable nil)))
     41    (handler-case
     42        (load-system-file (string-downcase (string module)))
     43      (t (e)
     44        (unless (and (typep e 'error)
     45                     (search "Failed to find loadable system file"
     46                             (format nil "~A" e)))
     47          (format *error-output* "Failed to require  ~A because '~A'~%"
     48                  module e))
     49        nil))))
     50   
     51(defvar *module-provider-functions* nil)
     52
    3953(defun require (module-name &optional pathnames)
    4054  (unless (member (string module-name) *modules* :test #'string=)
     
    4559               (load x)))
    4660            (t
    47              (let ((*readtable* (copy-readtable nil)))
    48                (load-system-file (string-downcase (string module-name))))))
     61             (unless (some (lambda (p) (funcall p module-name))
     62                           (append (list #'module-provide-system)
     63                                 sys::*module-provider-functions*))
     64               (error "Don't know how to ~S ~A." 'require module-name))))
    4965      (set-difference *modules* saved-modules))))
     66
Note: See TracChangeset for help on using the changeset viewer.