1 (in-package :COMMON-LISP-USER)
3 ;;; ---------------------------------------------------------------------------
5 #-EKSL-GENERIC-LOAD-UTILS
6 (let (#+MCL (*warn-if-redefine* nil))
7 (defun current-load-pathname ()
8 #+lucid lcl:*source-pathname*
9 #+allegro excl:*source-pathname*
10 #+(or Genera Explorer) sys:fdefine-file-pathname
11 #+MCL (if *load-truename*
13 ;; This makes it work in a fred buffer...
14 *loading-file-source-file*)
15 #-(or lucid allegro Genera Explorer MCL)
18 ;;; ---------------------------------------------------------------------------
20 (setf (logical-pathname-translations "GLU")
21 (list (list "GLU:ROOT;**;*.*.*"
25 (pathname-directory (current-load-pathname))
26 (list :wild-inferiors)))))))
28 ;;; ---------------------------------------------------------------------------
30 (defun eksl-load-if-exists (filespec &rest args &key (verbose t) &allow-other-keys)
31 (when (and filespec (probe-file filespec))
32 (apply #'load filespec :verbose verbose args)
35 ;;; ---------------------------------------------------------------------------
37 (defun load-sibling (name &rest args &key (verbose t) &allow-other-keys)
38 "Load the file named 'name' that lives in the same folder as THIS file."
39 (apply #'eksl-load-if-exists
40 (merge-pathnames name (current-load-pathname))
44 ;;; ---------------------------------------------------------------------------
46 (defun canonical-glu-file ()
47 (let ((current-directory (and (current-load-pathname)
48 (pathname-directory (current-load-pathname)))))
49 (when current-directory
52 (butlast current-directory 2)
53 (list "GENERIC-LOAD-UTILITIES" "DEV"))
54 :name "generic-load-utils"
57 ;;; ---------------------------------------------------------------------------
59 (defun load-in-canonical-place ()
60 (eksl-load-if-exists (canonical-glu-file)))
63 ;;; ---------------------------------------------------------------------------
66 "Attempt to load generic-load-utilities.lisp"
68 ;; Try the 'canonical' one
69 (load-in-canonical-place)
71 (load-sibling "generic-load-utils")
73 (warn "Unable to load generic-load-utilities. Please load it by hand before attempting to load or compile an EKSL load system.")))
76 ;;; ---------------------------------------------------------------------------
77 ;;; try to load generic utilities
78 ;;; ---------------------------------------------------------------------------
82 ;;; ***************************************************************************
84 ;;; ***************************************************************************