;;; Set up logical pathname translations:

(defun dirname (pathname)
  (make-pathname :name nil :type nil :version nil :defaults pathname))

(setf (logical-pathname-translations "PACKAGES")
      (list* `("EDU;MIT;AI;PSEUDO;*.*.*"
               ,(make-pathname :name :wild :type :wild :version :wild
                               :defaults (merge-pathnames "pseudo/*.*" (dirname *load-truename*))))
             `("EDU;MIT;AI;PSEUDO;*.*"
               ,(make-pathname :name :wild :type :wild
                               :defaults (merge-pathnames "pseudo/*.*" (dirname *load-truename*))))
             `("EDU;MIT;AI;PSEUDO;*"
               ,(make-pathname :name :wild
                               :defaults (merge-pathnames "pseudo/*" (dirname *load-truename*))))
             `("EDU;MIT;AI;PSEUDO;"
               ,(merge-pathnames "pseudo/" (dirname *load-truename*)))
             (ignore-errors (logical-pathname-translations "PACKAGES")))

      (logical-pathname-translations "LOADERS")
      (list* `("PSEUDO.*"
               ,(make-pathname :name "pseudo" :type :wild
                               :defaults (dirname *load-truename*)
                               :case :local))
             (ignore-errors (logical-pathname-translations "LOADERS"))))




;;; Define an autoload for scheme:

(defmacro defautoload (name arguments loader)
  "Defines a function that will load the LOADER file, before calling itself again."
  `(progn
     (declaim (notinline ,name))
     (defun ,name ,arguments
       "Autoload function."
       (load ,loader)
       (,name ,@arguments))))


;;; It doesn't work with ccl yet.
#-ccl
(defautoload scheme () (translate-logical-pathname #P"LOADERS:PSEUDO"))
ViewGit