Changeset 7324


Ignore:
Timestamp:
Sep 30, 2007, 12:40:36 AM (12 years ago)
Author:
gz
Message:

Make find-module-pathnames handle wildcards, and put "ccl:examples;;" on *module-search-path*.

Location:
branches/easygui/ccl/level-1
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/easygui/ccl/level-1/l1-files.lisp

    r6939 r7324  
    12561256(defun require (module &optional pathname)
    12571257  "Loads a module, unless it already has been loaded. PATHNAMES, if supplied,
    1258    is a designator for a list of pathnames to be loaded if the module
     1258   is a designator for a list of pathnames to be loaded if the/Users/gz/OpenMCL/trunk/ccl/examples/cocoa/easygui.lisp module
    12591259   needs to be. If PATHNAMES is not supplied, functions from the list
    12601260   *MODULE-PROVIDER-FUNCTIONS* are called in order with MODULE-NAME
     
    12861286  (let ((mod-path (make-pathname :name (string-downcase module) :defaults nil)) path)
    12871287        (dolist (path-cand *module-search-path* nil)
    1288           (when (setq path (find-load-file (merge-pathnames mod-path path-cand)))
    1289             (return path)))))
     1288          (let ((mod-cand (merge-pathnames mod-path path-cand)))
     1289            (if (wild-pathname-p path-cand)
     1290                (let* ((untyped-p (member (pathname-type mod-cand) '(nil :unspecific)))
     1291                       (matches (if untyped-p
     1292                                    (or (directory (merge-pathnames mod-cand *.lisp-pathname*))
     1293                                        (directory (merge-pathnames mod-cand *.fasl-pathname*)))
     1294                                    (directory mod-cand))))
     1295                  (when (and matches (null (cdr matches)))
     1296                    (return (if untyped-p
     1297                                (make-pathname :type nil :defaults (car matches))
     1298                                (car matches)))))
     1299                (when (setq path (find-load-file (merge-pathnames mod-path path-cand)))
     1300                  (return path)))))))
    12901301
    12911302(defun wild-pathname-p (pathname &optional field-key)
  • branches/easygui/ccl/level-1/l1-pathnames.lisp

    r6941 r7324  
    701701(defparameter *module-search-path* (list
    702702                                    (cons-pathname '(:absolute "bin") nil nil "ccl")
    703                                     (cons-pathname  '(:absolute "openmcl" "modules") nil nil "home")
     703                                    (cons-pathname '(:absolute "openmcl" "modules") nil nil "home")
    704704                                    (cons-pathname '(:absolute "lib") nil nil "ccl")
    705705                                    (cons-pathname '(:absolute "library") nil nil "ccl")
    706                                     (cons-pathname '(:absolute "examples") nil nil "ccl")
     706                                    (cons-pathname '(:absolute "examples" :wild-inferiors) nil nil "ccl")
    707707                                    (cons-pathname '(:absolute "tools") nil nil "ccl")
    708708                                    (cons-pathname '(:absolute "objc-bridge") nil nil "ccl")
Note: See TracChangeset for help on using the changeset viewer.